Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    Oslo
    Posts
    45

    Unanswered: 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

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    sounds kinda like a basic homework/assignment question to me.... you probably want to do a google search on something like "asp database queries"

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •