javascript help
any help would be appreciated
here is the code and divs and select.
functions
function showCustomers(str) {
if (str=="") {
document.getElementById("txtcustomer").innerHTML=" ";
return;
}
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("txtcustomer").innerHTML=x mlhttp.responseText;
}
}
xmlhttp.open("GET","customers.php?c="+str,true);
xmlhttp.send();
}
function showNotes(str) {
if (str=="") {
document.getElementById("txtnotes").innerHTML="";
return;
}
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("txtnotes").innerHTML=xmlh ttp.responseText;
}
}
xmlhttp.open("GET","notes.php?q="+str,true);
xmlhttp.send();
}
select code
echo '<select name="customers" onchange="showCustomers(this.value);">';
echo '<option value="0">Select Customer</option>';
$queryc = "SELECT * FROM customers ORDER BY lastname";
$resultc = mysql_query($queryc) or die(mysql_error());
while($rowc = mysql_fetch_array($resultc)){
echo '<option value="'.$rowc['id'].'">'.$rowc['lastname'].', '.$rowc['firstname'].'</option>';
}
echo '</select>';
divs
<div id="txtcustomer">FORM HERE</div>
<div id="txtnotes"></div>
-
Earnie Boyd -
Thanks
SignatureEarnie Boyd{{ DiscussionBoard.errors[5905899].message }} -