Problem - Parsing information using onchange in two select fields

P

please-answer-here

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
 
G

Giles

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
 
P

please-answer-here

Giles said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top