george Posted March 6, 2008 Share Posted March 6, 2008 I have a form which auto populates with values when one selects a city from a list. The onchange event of the select control calls a javascript function which uses AJAX to pass a query to a php script which returns an XML which is picked up by another javascript function which calls a series of document.getElementById('POC_City').value = xmlDoc.getElementsByTagName("POC_City")[0].childNodes[0].nodeValue; which populate the other fields in the form. But some of them weren't populating. <td><input type="text" name="POC_City" id="POC_City" size="25" maxlength="50" tabindex="31" /></td> untill I added a name attribute which contained the same content as the id. Why did this make it work? I am beginning to think I do not know my name from my id, or my browser doesn't. Why does this not work just using the id? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 6, 2008 Share Posted March 6, 2008 It should work with just the ID, it might be a browser bug or something like that. But, you should also have a name on all input elements that you want to submit. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.