Hi. I have created a form with 4 textboxes and one listbox. What I want to do is for every record which i select from the list to populate the boxes with information from a MySql database. I have managed to do this for one textbox, but i have a problem when doing the same for more then one textbox (DIV). Below is the code I am using to identify the div and write the info in the right place, for only one text box.
THE FORM
//the form also contains the function getInfoNetwork
<td width="<?php echo $col3; ?>"><label>Address:
<div id="NetAddress"><input type="text" name="txtNetAddress" /></div>
</label></td>
<td width="<?php echo $col3; ?>"><label>Address:
<div id="NetMask"><input type="text" name="txtNetMask" /></div>
</label></td>
THE AJAX FUNCTION
function getInfoNetwork(networkID){
var strURL = "findNetworkInfo.php?networkID="+networkID;
var req = getXMLHTTP();
if (req){
req.onreadystatechange = function(){
if(req.readyState == 4){
if(req.status == 200){
document.getElementById('NetAddress').innerHTML = req.responseText;
}else{
alert("There was a problem while using XMLHTTP:\n"+req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
PLACING THE INFO IN THE RIGHT DIV
//THIS CODE IS IN THE findNetworkInfo.PHP FILE, ALSO THE FUNCTION getInfoNetwork
<input type="text" id="NetAddress" name="txtNetAddress" value="ccccc"/>
What should i do to transfer the DIV NetMask along? Thank you!