K
Keith Page
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,sw";
//change the cities quadrent
function write_quadrent(city_id){
var quadrents = cities[city_id].split(",");
var newnode = document.createElement("div");
newnode.id = "advanced_city_quadrent";
for(var i = 0; i < quadrents.length; i++){
var newnode_input = document.createElement("INPUT");
newnode_input.type = "checkbox";
newnode_input.name = "quadrent";
newnode_input.id = "quadrent";
newnode_input.value = quadrents;
var newnode_text = document.createTextNode(quadrents);
newnode.appendChild(newnode_input);
newnode.appendChild(newnode_text);
}
//create new node
var par = document.getElementById("advanced_city_quadrent_holder");
var checkboxes = document.getElementById("advanced_city_quadrent");
var replaced = par.replaceChild(newnode,checkboxes);
}
END JAVASCRIPT ////
<form id="propertysearch" name="propertysearch"
action="/cmn/apps/form_router.php" method="post">
<div id="advanced_city_quadrent_holder">
<div id="advanced_city_quadrent">
<script type="text/javascript">
write_quadrent(readCookie('city'));
</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,sw";
//change the cities quadrent
function write_quadrent(city_id){
var quadrents = cities[city_id].split(",");
var newnode = document.createElement("div");
newnode.id = "advanced_city_quadrent";
for(var i = 0; i < quadrents.length; i++){
var newnode_input = document.createElement("INPUT");
newnode_input.type = "checkbox";
newnode_input.name = "quadrent";
newnode_input.id = "quadrent";
newnode_input.value = quadrents;
var newnode_text = document.createTextNode(quadrents);
newnode.appendChild(newnode_input);
newnode.appendChild(newnode_text);
}
//create new node
var par = document.getElementById("advanced_city_quadrent_holder");
var checkboxes = document.getElementById("advanced_city_quadrent");
var replaced = par.replaceChild(newnode,checkboxes);
}
END JAVASCRIPT ////
<form id="propertysearch" name="propertysearch"
action="/cmn/apps/form_router.php" method="post">
<div id="advanced_city_quadrent_holder">
<div id="advanced_city_quadrent">
<script type="text/javascript">
write_quadrent(readCookie('city'));
</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.