Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CustomValidator failing

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
AU
I have a customvalidator control checking an email text control (input). It is set to run the function below, but marks the page as invalid, even though I have satisfied the criteria.

Code:
<script language="javascript"  type="text/javascript" >
		Function CheckEmail(source,arguments)
		{
		If (arguments.value.indexof("S") == -1)
			{
				arguments.isvalid = false
			}
			else
			{
				arguments.isvalid = true
			}
		}
	</script>

The HTML source is :

Code:
<asp:CustomValidator ID="CustValEmail" runat="server" ErrorMessage="Email Must contain an 'S'" ClientValidationFunction="CheckEmail" ControlToValidate="txtEmail" Display="Dynamic"></asp:CustomValidator>

Thanks

The risk with keeping an open mind is having your brains fall out.
Shaunk

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top