Submitting a form depending on the select box answer

R

Rabel

Hi I would like to submit a form to different pages depending on the
answer given in the select box(I also have a few other textfields so
its not a link) . I think that I will give the answers the values of
pages like this.

<SELECT name="txtdept" class="style4" id="txtdept">
<OPTION Selected >None
<option value="page1.asp">Community Service
<option value="page2.asp">Adventurers
</SELECT>

But I am having trouble figuring out how I would tell the form about
reading the txtdept, any help is apprieciated.


Thanks,
Randy
 
L

Lee

Rabel said:
Hi I would like to submit a form to different pages depending on the
answer given in the select box(I also have a few other textfields so
its not a link) . I think that I will give the answers the values of
pages like this.

<SELECT name="txtdept" class="style4" id="txtdept">
<OPTION Selected >None
<option value="page1.asp">Community Service
<option value="page2.asp">Adventurers
</SELECT>

But I am having trouble figuring out how I would tell the form about
reading the txtdept, any help is apprieciated.

<form onsubmit="action=this.txtdept.options[this.textdept.selectedIndex].value"


--
 
R

Rabel

Rabel said:


Hi I would like to submit a form to different pages depending on the
answer given in the select box(I also have a few other textfields so
its not a link) . I think that I will give the answers the values of
pages like this.
<SELECT name="txtdept" class="style4" id="txtdept">
<OPTION Selected >None
<option value="page1.asp">Community Service
<option value="page2.asp">Adventurers
</SELECT>
But I am having trouble figuring out how I would tell the form about
reading the txtdept, any help is apprieciated.

<form onsubmit="action=this.txtdept.options[this.textdept.selectedIndex].value"

--

Thanks Lee that worked but just for anyone else that comes to this
code (typo above) is

<form
onsubmit="action=this.txtdept.options[this.txtdept.selectedIndex].value"
method="post">
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top