PDA

Click to See Complete Forum and Search --> : Form Drop List


ChR0NiC
Jul 31st, 2004, 07:30 PM
Basically I was wanting to write something to select a language that would then forward you onto the specified page. But I was wondering if I could use a function for the language or something so it could forward me to the next page. As you can see below, I tried writing a function in PHP and Javascript using the switch statement but nothing is seeming to work.


<html>
<head><title>Welcome To The WCG Tour Registration</title></head>
<body>
<center>

<form name="form" action=getpage() method="POST">
<table align="center" width="100" height="200">
<tr><td><select name="language">
<option value="English">English</option>
<option value="Spanish">Español</option>
<option value="Portugese">Português</option>
<option value="Japanese">日本語</option>
<option value="French">Français</option>
<option value="Korean">한국어</option></td>
</select>
<td><input type="submit" value="Submit"></td></tr></table>
</form>
<font color=white size=3 face=Verdana>Please select a language, if you do not see a

language that applies to you, you do not qualify for this tournament.</font>
</center>

</body>
</html>

visualAd
Aug 1st, 2004, 02:14 AM
You action attribute in the form needs to be an address of the page you are submitting the infoamtion to. If you want to apply a function before submitting the form you should use the forms on submit event.

<form id="formlanguage" action="nextpage.php" onsubmit="getpage()" method="POST">

Ideally you'll want to do as much in PHP as possible. Have the nextpage.php page select the appropriate lanaguage, rather than Javascript.