By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

Submitting a form depending on the select box answer

P: n/a
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

Jun 13 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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"
--

Jun 13 '07 #2

P: n/a
On Jun 13, 1:30 pm, Lee <REM0VElbspamt...@cox.netwrote:
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">

Jun 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.