Problem - Parsing information using onchange in two select fields

Discussion in 'ASP General' started by please-answer-here, May 30, 2005.

  1. Scenario:

    I'm having an asp page with a form with an action pointing to itself. The
    reason for that, it that the asp page depending on changes in any of two
    select fields with data from 2 different databasetables are going to
    populate a third select field.

    what I have done is something like:

    response.write("<select size=""1"" name=""fabrikat""
    onchange=""document.forms[0].submit()"" >")
    response.write("<select size=""1"" name=""type""
    onchange=""document.forms[0].submit()"" >")

    what I very much would like was a way that I in the asp page when it got
    reloaded could check which of the "select" fields have generated the submit.
    If I had used submit buttons I could have used a querystring, but as the
    reload of the page sholud happen transparent to the user it is out of the
    question

    regards
    Henning
     
    please-answer-here, May 30, 2005
    #1
    1. Advertising

  2. please-answer-here

    Giles Guest

    > response.write("<select size=""1"" name=""fabrikat""
    > onchange=""document.forms[0].submit()"" >")
    > response.write("<select size=""1"" name=""type""
    > onchange=""document.forms[0].submit()"" >")
    >
    > what I very much would like was a way that I in the asp page when it got
    > reloaded could check which of the "select" fields have generated the
    > submit.


    Try
    <input type="hidden" name="WhichSelect">
    <select size=""1"" name=""fabrikat""
    onchange="document.forms[0].WhichSelect.value="fabrikat";document.forms[0].submit()">

    and for the other one:
    onchange="document.forms[0].WhichSelect.value="type";document.forms[0].submit()">

    Hope that helps
    Giles
     
    Giles, May 31, 2005
    #2
    1. Advertising

  3. Giles wrote:
    >> response.write("<select size=""1"" name=""fabrikat""
    >> onchange=""document.forms[0].submit()"" >")
    >> response.write("<select size=""1"" name=""type""
    >> onchange=""document.forms[0].submit()"" >")
    >>
    >> what I very much would like was a way that I in the asp page when it
    >> got reloaded could check which of the "select" fields have generated
    >> the submit.

    >
    > Try
    > <input type="hidden" name="WhichSelect">
    > <select size=""1"" name=""fabrikat""
    > onchange="document.forms[0].WhichSelect.value="fabrikat";document.forms[0].submit()">
    >
    > and for the other one:
    > onchange="document.forms[0].WhichSelect.value="type";document.forms[0].submit()">
    >
    > Hope that helps
    > Giles


    Thanks very much. That was just what I needed
     
    please-answer-here, May 31, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Eghbal
    Replies:
    2
    Views:
    129
    GIMME
    Sep 15, 2003
  2. Paul Eghbal
    Replies:
    3
    Views:
    158
    Paul Eghbal
    Sep 18, 2003
  3. Ryan McGeary
    Replies:
    2
    Views:
    204
    Thomas 'PointedEars' Lahn
    Jan 7, 2004
  4. AMT2K5
    Replies:
    1
    Views:
    208
    Eric Schwartz
    Nov 8, 2005
  5. Evolution

    onChange without using select?

    Evolution, May 31, 2011, in forum: Javascript
    Replies:
    1
    Views:
    120
    Jeff North
    May 31, 2011
Loading...

Share This Page