Form Scripting problem, help please!
Posted: Sat Jan 03, 2009 5:13 pm
ok, this is the final part i need to have for my site.
i can't get it to check whether the form has been filled in or not...
Code:
if anyone can help, it is greatly appreciated, with this done i can finally rest a bit T__T
edit:
i got the basics fro this site
http://www.geocities.com/sunsetstrip/al ... .htm#sec23
i can't get it to check whether the form has been filled in or not...
Code:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body> <script type="text/javascript">
function testform()
{
if(document.forms[0].elements[0].value==""
|| document.forms[0].elements[1].value=="none"
|| document.forms[0].elements[2].value==""
|| document.forms[0].elements[3].value==""
|| document.forms[0].elements[4].value=="")
{
alert("You must fill in all the information in this form")
}
}
</SCRIPT>
<form>
<tr>
<td>Please enter your Name</td><br>
<td><input type="text" name="Name" size="50" maxlength="35" /></td>
</tr>
<br><br>
<tr>
<td>What is your age?</td><br>
<td>
<select name="age">
<option>none</option
<option>5 </option>
<option>6 </option>
<option>7 </option>
<option>8 </option>
<option>9 </option>
<option>10 </option>
<option>11 </option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15 </option>
<option>16 </option>
<option>17 </option>
<option>18 </option>
<option>19 </option>
<option>20 </option>
<option>older than 20 </option>
</select>
</td>
</tr>
<br><br>
<tr>
<td valign="top">What is your favorite Character</td><br>
<td>
<input type="radio" name="character" value="Sonic" />Sonic
<input type="radio" name="character" value="Knuckles" />Knuckles
<input type="radio" name="character" value="Tails" />Tails
<input type="radio" name="character" value="Shadow" />Shadow
<input type="radio" name="character" value="Rouge" />Rouge
<input type="radio" name="character" value="Eggman" />Eggman
<input type="radio" name="character" value="Omega" />Omega
<input type="radio" name="character" value="Metal" />Metal
</td>
</tr>
<br><br>
<tr>
<td valign="top">What are your favorite games?</td><br>
<td>
<input type="checkbox" name="game" value="Sonic 2D games" />Sonic 2D games<br />
<input type="checkbox" name="game" value="Sonic Adventure 1" />Sonic Adventure 1<br />
<input type="checkbox" name="game" value="Sonic Adventure 2" />Sonic Adventure 2<br />
<input type="checkbox" name="game" value="Sonic Heroes" />Sonic Heroes<br />
<input type="checkbox" name="game" value="Sonic the hedgehog 2006" />Sonic the hedgehog 2006<br />
<input type="checkbox" name="game" value="Shadow the Hedgehog" />Shadow the Hedgehog<br />
<input type="checkbox" name="game" value="Sonic and the Secret Rings" />Sonic and the Secret Rings<br />
<input type="checkbox" name="game" value="Sonic Unleashed" />Sonic Unleashed<br />
</td>
</tr>
<br>
<tr>
<td><button type="reset">Reset</button></td>
<td><INPUT TYPE="button" VALUE="send e-mail" onClick="self.location='mailto:SonicDX_Adventure@Hotmail.com';"></td>
<form action=mailto:Sonicdx_adventure@hotmail.com method="Email" name="form"></script>
</tr>
</form>
</body>
</html>if anyone can help, it is greatly appreciated, with this done i can finally rest a bit T__T
edit:
i got the basics fro this site
http://www.geocities.com/sunsetstrip/al ... .htm#sec23