Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, i want create a web page in

Status
Not open for further replies.

sunila7

Technical User
Apr 11, 2001
1,087
US
Hi,

i want create a web page in which there is a phone no field an on the lost focus event of that i want to fill in the rest of the field like address's coreesponding to the phone number. I am using ASP for server side scripting

and on submiting the form i want to go to next page is that possible

thanks

Sunil
 
I don't quite get what you mean, this just sounds like an ordinary form?

What exactly should happen? Do the other fields fill themselves in? How? Please be more specific!

;-)
 
I can't think of any efficient way to do it but there's a way. I am assuming these are known phone numbers and addresses stored in a database. If the database isn't huge and won't get huge I would try this:

Connect to your db using ASP when the page loads and SELECT the entire table where the phone numbers and addresses are stored. Response.Write a DIV with hidden visibility. Response.Write SELECT objects for each field, phone #, address line 1, address line 2, etc, into that DIV using the information in the recordset you created. So you end up with a hidden DIV with all the phone number/address info stored in SELECT objects (drop down lists) on the client computer. Then when the phone number text box loses focus, iterate thru the hidden phone number drop down for a match. If you get one all you have to do is pull the information from the other drop downs using the same index into your address fields.

Like I said, not efficient in any way (well, except that the client will see the address fields fill out almost immediately, but with a major upfront cost). But if it must be done it can. There might be an easier way to store an array of information using ASP where JavaScript can find it on the client end. But I don't know of one.
 
Good idea, and to write in client do just that, write the array in from the db.
<%
With Response
' Iterate thu records
.write &quot;<script language='JavaScript'>&quot;
.write &quot;var names = new Array()&quot;
.write &quot; names[0] =&quot; & strSomeValueFromDb
...
.write &quot;</script>&quot;

End with
%>


you know something like that, to limit server connections. JavaScript can then read you array. P.S. you did extremely well to make sense of the question ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top