H
hbm9966
Hi everybody
I have the following form written in html which I need to validate.
Have tried a few things, but the validation bit written in javascript
does not seem to be getting accessed at all.
Can somebody please tell me what is wrong.
Thanks and regards,
hbm9966
<html>
<head>
<title>Contact us - Right Investments India</title>
<link rel="shortcut icon" href="favicon.ico">
<META Name="description" Content="Maximise your investment returns
while investing minimum time and effort">
<META Name="keywords" Content="equity, shares, stocks, pms, "portfolio
management", newsletters, trading, "technical analysis", investing">
<SCRIPT LANGUAGE="JavaScript">
function validate() {
alert("reached validation");
if (document.formail.Reply-to.value = "Enter your e-mail address
here"){
alert("Please enter your correct e-mail address");
return false;
}
if (document.formmail.subject.value.length < 3){
alert("Please enter a subject for your mail");
return false;
}
if (document.formmail.Text.value.length<3){
alert("Cannot send blank message");
return false;
}
return true;
}
</SCRIPT>
</head>
<body>
<blockquote>
<table rules=none border=0>
<td width = "30%">
<a href=index.html><img src = ".\images\logo3.gif" border=0
alt="Home"></a>
<td width = "70%" align = right>
<hr size=3 color=gold width=100% align=right>
<center><h3>Contact   Us</h3></center>
<hr size=3 color=gold width=100% align=right>
<td width = "0%">
</tr>
</table>
<form name="formmail" method="post" action="./formmail.php"
onSubmit="validate();">
<input type=hidden name="recipient" value="(e-mail address removed)">
<b>From</b><br>
<input size=48 name="Reply-to" value="Enter your e-mail address here">
<br>
<input type=hidden name="email" value="(e-mail address removed)">
<b>Subject</b><br>
<input size=58 name="subject">
<br>
<b>Message</b><br>
<textarea cols=50 rows=6 name="Text"></textarea>
<input type="submit" value="Send">
<font
size=6>            </font>
<font size=1>    </font>
<a href="javascript:history.back()"><img src=".\images\backarrow.gif"
border=0></a>
<input type="hidden" name="redirect" value=".\thankspage.html">
</form>
</blockquote>
</body>
</html>
I have the following form written in html which I need to validate.
Have tried a few things, but the validation bit written in javascript
does not seem to be getting accessed at all.
Can somebody please tell me what is wrong.
Thanks and regards,
hbm9966
<html>
<head>
<title>Contact us - Right Investments India</title>
<link rel="shortcut icon" href="favicon.ico">
<META Name="description" Content="Maximise your investment returns
while investing minimum time and effort">
<META Name="keywords" Content="equity, shares, stocks, pms, "portfolio
management", newsletters, trading, "technical analysis", investing">
<SCRIPT LANGUAGE="JavaScript">
function validate() {
alert("reached validation");
if (document.formail.Reply-to.value = "Enter your e-mail address
here"){
alert("Please enter your correct e-mail address");
return false;
}
if (document.formmail.subject.value.length < 3){
alert("Please enter a subject for your mail");
return false;
}
if (document.formmail.Text.value.length<3){
alert("Cannot send blank message");
return false;
}
return true;
}
</SCRIPT>
</head>
<body>
<blockquote>
<table rules=none border=0>
<td width = "30%">
<a href=index.html><img src = ".\images\logo3.gif" border=0
alt="Home"></a>
<td width = "70%" align = right>
<hr size=3 color=gold width=100% align=right>
<center><h3>Contact   Us</h3></center>
<hr size=3 color=gold width=100% align=right>
<td width = "0%">
</tr>
</table>
<form name="formmail" method="post" action="./formmail.php"
onSubmit="validate();">
<input type=hidden name="recipient" value="(e-mail address removed)">
<b>From</b><br>
<input size=48 name="Reply-to" value="Enter your e-mail address here">
<br>
<input type=hidden name="email" value="(e-mail address removed)">
<b>Subject</b><br>
<input size=58 name="subject">
<br>
<b>Message</b><br>
<textarea cols=50 rows=6 name="Text"></textarea>
<input type="submit" value="Send">
<font
size=6>            </font>
<font size=1>    </font>
<a href="javascript:history.back()"><img src=".\images\backarrow.gif"
border=0></a>
<input type="hidden" name="redirect" value=".\thankspage.html">
</form>
</blockquote>
</body>
</html>