I have a page that changes a list of checkboxes based on what city you
select, however when i insert the new nodes the values are not
submitted when the boxes are checked and form is sent, its like they
are not hooked to the form properly.
Any help would be appritiated
JAVASCRIPT ///
cities[0] = "ne,nw,se,s w";
//change the cities quadrent
function write_quadrent( city_id){
var quadrents = cities[city_id].split(",");
var newnode = document.create Element("div");
newnode.id = "advanced_city_ quadrent";
for(var i = 0; i < quadrents.lengt h; i++){
var newnode_input = document.create Element("INPUT" );
newnode_input.t ype = "checkbox";
newnode_input.n ame = "quadrent";
newnode_input.i d = "quadrent";
newnode_input.v alue = quadrents[i];
var newnode_text = document.create TextNode(quadre nts[i]);
newnode.appendC hild(newnode_in put);
newnode.appendC hild(newnode_te xt);
}
//create new node
var par = document.getEle mentById("advan ced_city_quadre nt_holder");
var checkboxes = document.getEle mentById("advan ced_city_quadre nt");
var replaced = par.replaceChil d(newnode,check boxes);
}
END JAVASCRIPT ////
<form id="propertysea rch" name="propertys earch"
action="/cmn/apps/form_router.php " method="post">
<div id="advanced_ci ty_quadrent_hol der">
<div id="advanced_ci ty_quadrent">
<script type="text/javascript">
write_quadrent( readCookie('cit y'));
</script>
</div>
</div>
<input type="submit" value="submit"/>
</form>
So in the example given above you can say the cookie city is set to 0,
it goes through and writes a checkbox for each quadrent given for that
city, that works fine and the boxes change but when i submit them they
don't send any values.
select, however when i insert the new nodes the values are not
submitted when the boxes are checked and form is sent, its like they
are not hooked to the form properly.
Any help would be appritiated
JAVASCRIPT ///
cities[0] = "ne,nw,se,s w";
//change the cities quadrent
function write_quadrent( city_id){
var quadrents = cities[city_id].split(",");
var newnode = document.create Element("div");
newnode.id = "advanced_city_ quadrent";
for(var i = 0; i < quadrents.lengt h; i++){
var newnode_input = document.create Element("INPUT" );
newnode_input.t ype = "checkbox";
newnode_input.n ame = "quadrent";
newnode_input.i d = "quadrent";
newnode_input.v alue = quadrents[i];
var newnode_text = document.create TextNode(quadre nts[i]);
newnode.appendC hild(newnode_in put);
newnode.appendC hild(newnode_te xt);
}
//create new node
var par = document.getEle mentById("advan ced_city_quadre nt_holder");
var checkboxes = document.getEle mentById("advan ced_city_quadre nt");
var replaced = par.replaceChil d(newnode,check boxes);
}
END JAVASCRIPT ////
<form id="propertysea rch" name="propertys earch"
action="/cmn/apps/form_router.php " method="post">
<div id="advanced_ci ty_quadrent_hol der">
<div id="advanced_ci ty_quadrent">
<script type="text/javascript">
write_quadrent( readCookie('cit y'));
</script>
</div>
</div>
<input type="submit" value="submit"/>
</form>
So in the example given above you can say the cookie city is set to 0,
it goes through and writes a checkbox for each quadrent given for that
city, that works fine and the boxes change but when i submit them they
don't send any values.
Comment