Lets say I have 4 simple text boxes:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TextBox Fill-In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="">
Customer # <input name="CustomerNumber" type="text" id="CustomerNumber"><br>
Company Name <input name="CustomerName" type="text" id="CustomerName"><br>
Contact Name <input name="ContactName" type="text" id="ContactName"><br>
Email Address <input name="RecipEmail" type="text" id="RecipEmail">
</form>
</body>
</html>
I want to be able to fill in the CustomerNumber and IF that number has been previously defined in the Javascript, CustomerName, ContactName, and RecipEmail will be automatically completed.
Example: if I type in "12345" into CustomerNumber I will get an output of "Bob's Furniture" in the CustomerName, "Bob" in the ContactName, and "bob@bobfurniture.com" in RecipEmail. But if I type in "54321" and it is not defined, the other three are simply left blank for me to type in manually.
Note: It would be even better if every time I manually entered one, the other three fields were stored in a database...but I'll save that one for another day
I know I have seen similar scripts with dropdowns, but never with a textbox and I haven't found one that works anywhere close to the way I desire. Anyone have ideas?