Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Populate field 2 (run Query) based on input in field 1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-04, 06:05
Mirador Mirador is offline
Master Chinchilla
 
Join Date: Jan 2004
Location: Oslo
Posts: 45
Populate field 2 (run Query) based on input in field 1

Hi there !!

I got a table (Postinfotable) which looks like this :

Postnr | Poststed
-------------------
0010 Oslo
0456 Oslo
2800 Gjovik
2850 Raufoss
-------------------

In my ASP page, i want to make the user to input (text field) a "Postnr" and when user exits/refresh/onBlur (or anything) the field, it should run a sql query against the Postinfotable with "Postnr" to lookup the correct "Poststed" for that "Postnr" and insert that into the "Postnummer" form-field..

How can this be done ?
If someone has a URL/Webpage/Metods to use i'd be extremely happy.. kinda stuck with this

Best regards
Terje
__________________
Best regards
Mirador
Reply With Quote
  #2 (permalink)  
Old 10-11-04, 20:20
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
sounds kinda like a basic homework/assignment question to me.... you probably want to do a google search on something like "asp database queries"
Reply With Quote
  #3 (permalink)  
Old 10-12-04, 04:42
Mirador Mirador is offline
Master Chinchilla
 
Join Date: Jan 2004
Location: Oslo
Posts: 45
Solution :

Yea.. u prolly right, but i've googled this for quite many hours.. Might be that i lack brain to find correct searchwords though

But.. the good news is that i managed to work it out..

Solution :

using OnChange() event on the "Postnr" field, which triggers a function with an IFRAME (which is _not_ a popup), with "postnr" as parameter.
Using Request.GetParameter("postnr") and put it in a temp variable.
Then i build the SQL query with the temp variable and picks out the Postnr, followed by putting the value into a hidden field on the "IFRAME" form.

End it all with sending the value to the parent form and closing the window..

Voila..
__________________
Best regards
Mirador
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On