Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-06-2005, 04:22 PM   PM User | #1
sftl99
Regular Coder

 
Join Date: Apr 2005
Location: austin, tx
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
sftl99 is an unknown quantity at this point
Textbox AutoComplete Advanced

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?
sftl99 is offline   Reply With Quote
Old 07-06-2005, 07:13 PM   PM User | #2
SpirtOfGrandeur
Regular Coder

 
Join Date: May 2005
Location: Michigan, USA
Posts: 566
Thanks: 0
Thanked 0 Times in 0 Posts
SpirtOfGrandeur is an unknown quantity at this point
You are looking for something using the XMLHTTPRequest Object and a Database back end...
SpirtOfGrandeur is offline   Reply With Quote
Old 07-06-2005, 07:16 PM   PM User | #3
sftl99
Regular Coder

 
Join Date: Apr 2005
Location: austin, tx
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
sftl99 is an unknown quantity at this point
I figured as much. Not as easy as I thought it might be.
sftl99 is offline   Reply With Quote
Old 07-06-2005, 08:14 PM   PM User | #4
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,353
Thanks: 3
Thanked 457 Times in 444 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
see

http://homepage.ntlworld.com/vwphill...endium.htm#f12
vwphillips is offline   Reply With Quote
Old 07-06-2005, 09:30 PM   PM User | #5
sftl99
Regular Coder

 
Join Date: Apr 2005
Location: austin, tx
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
sftl99 is an unknown quantity at this point
not quite what i'm looking for, but a very cool script. i've looked into this more and i'm pretty sure i'm going to need to set up a MySQL database...which i have no idea how to do!
sftl99 is offline   Reply With Quote
Old 07-06-2005, 09:51 PM   PM User | #6
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,353
Thanks: 3
Thanked 457 Times in 444 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
up to 4k can be stored in a cookie
vwphillips is offline   Reply With Quote
Old 07-06-2005, 09:58 PM   PM User | #7
sftl99
Regular Coder

 
Join Date: Apr 2005
Location: austin, tx
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
sftl99 is an unknown quantity at this point
it's not a cookie thing i'm trying to do. it's more similar to this example on your page: http://homepage.ntlworld.com/vwphill...eSelectBox.htm.

except instead of select boxes it's text boxes. here is my live example where i am wanting to eventually implement this. www.jasonpcarroll.com/allcomponents/quote.html. See the right column...I want to be able to fill in the Customer # and have Customer Name, Contact, and Customer Email automatically fill in. I would have at least 10 different Customer #'s with the other variables assigned.

Do you think it's doable just in Javascript? I could just start out using 3 or 4 customer #'s and wait until I figure out the database method before I go crazy.
sftl99 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:58 AM.


Advertisement
Log in to turn off these ads.