I want users to be able to pulldown a drop down box that will pull a clients name, address...... from a profile database that is already working.
What I want is when they choose the dropdown to have it fill in text fields that they can edit and resubmit. from what I gather this is something that will probably require JAVA. I've messed around and put together the following that works as far as creating the "dynamic" drop down and the JAVA to fill in the first text box. But here I am stuck...
Any ideas on how this could be done?
Here's the code that is working to fill in the dropdown which is filling in the first text box just dandy:
Code: Select all
<head>
<Script Language="JavaScript">
function fillText()
{
document.testForm.DetailText.value=document.testForm.OperationDropDown.value;
}
</Script>
</head>
<body>
<?php
[color=#FF0000]--------ALL SQL CONNECTION OMMITED--------------[/color]
$sql="SELECT * FROM profile ORDER BY name";
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {
$id=$row["id"];
$name=$row["name"];
$options.="<OPTION VALUE=\"$name\">".$name;
}
?>
<form name="testForm" id="testForm" action="">
Make Selection<br><br>
<select name="OperationDropDown" onChange="fillText()">
<option value="" selected="true">New Shipper</option>
<option <?=$options?></option>
</select><br>
<input type="text" name="DetailText" id="DetailText" size="10">
</form>
<form action="proc_bol.php" method="post">
<b>
</body></html>