Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell driver drivers email error ethernet excel firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition password problem router slow software sound trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Simple redirection question


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
jlee's Avatar
Junior Member with 14 posts.
 
Join Date: Jul 2004
Location: Nottingham
09-Aug-2004, 12:54 PM #1
Simple redirection question
Hi guys

I have a page with a form as folows:

<form name="myform" action="" method="post">
<select name="select">
<option>Add</option>
<option>Delete</option>
<option>Edit Project</option>
</select>
<input type="submit" name="submit" value="Select" onClick="option();"></form>


All I want to do is when somone chooses one of the options in the drop down box, and clicks the submit button, they are taken to the specific page already created for each option. I started off trying javascript and defining the option() function in the header trying something like:

<script language="JavaScript">
function option(){
if document.myform.select.selectedindex == 0
{
window.location="add.php");
}
else if document.myform.select.selectedindex == 1
{
window.location="delete.php";
}
}
etc etc

I just cant get it to work - any ideas?
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
09-Aug-2004, 01:03 PM #2
Set the action of the form element and use the onChange to send them on their merry way.

onChange = "myForm.Submit()"
jlee's Avatar
Junior Member with 14 posts.
 
Join Date: Jul 2004
Location: Nottingham
09-Aug-2004, 01:15 PM #3
Quote:
Originally Posted by Rockn
Set the action of the form element and use the onChange to send them on their merry way.

onChange = "myForm.Submit()"

What do I set the action of the form element to?
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:28 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.