473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Submitting a form depending on the select box answer

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
2 1340
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Duke Hamacher | last post by:
Hello: This title is a little ambiguous but this is an interesting puzzle. Lets's say we have a JSP page with a form. The ActionForm associated with this form has, say, 4 String properities. ...
3
by: Sara | last post by:
Hi all, I don't know if this is possible or if it even makes sense, but this is what I want to do. I have a page with a form to fill in a timesheet for a user. Depending on how many users did a...
5
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
14
by: threeflush | last post by:
I'm supporting an ASP legacy application and need to implement "autosave" functionality. I have two frames, one that holds tabs displaying different pages a user can select, and the other that...
2
by: MickG | last post by:
I think that this should be reasonably easy but it is proving to be hugely difficult. I am wanting to reset the form to all the original values when I submit the form. Here is the select box...
19
by: Alex | last post by:
Hello list This question has probably already been asked, but let me ask again I have a mysql database to which I connect with my php scripts. The database contains articles. Name, Unit_Price...
7
by: FP | last post by:
This should be simple but I just can't seem to figure it out. I have a form with 2 checkboxes in it. Clicking either checkbox runs a js function which opens a new window. The form targets that...
1
by: Rozy | last post by:
Hi, I've created a database for and IT support company. I want the main support form to have a drop down list so it asks either "laptop, printer, server" etc. Depending on the answer i select i...
1
by: dittu | last post by:
How to close the popup window when submitting the form? I have a sample.jsp. In that page one button is there. when button pressed, open popup window contains one "text box" and one " submit...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.