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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

registration form validation 1

Status
Not open for further replies.

PushCode

Programmer
Dec 17, 2003
573
US
I need help with my registration form. It was working fine until I added a RegularExpressionValidator. Now it seems I can enter whatever I want in any field I want, and the form submits without error. Even If I take out the RegularExpressionValidator none of the other code is working now. It just submits the form without error, no matter what bad info I enter.

Can someone help me debut this code?

Here's the form code:

<form runat=&quot;server&quot; name=&quot;register&quot;>
<div align=&quot;left&quot;> </div>
<table width=&quot;100%&quot; border=&quot;0&quot;>
<tr valign=&quot;top&quot;>
<td width=&quot;27%&quot; class=&quot;body&quot;>Username:</td>
<td width=&quot;73%&quot; class=&quot;body&quot;><asp:TextBox id=&quot;MAJOR_KEY&quot; runat=&quot;server&quot;></asp:TextBox></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;><br>
Choose a Password:</td>
<td class=&quot;body&quot;><br> <asp:TextBox id=&quot;PASSWORD&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;PASSWORDReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Password. &quot; ControlToValidate=&quot;PASSWORD&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>
*</asp:RequiredFieldValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;>Confirm Password:</td>
<td class=&quot;body&quot;><asp:TextBox id=&quot;PASSWORD2&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;PASSWORD2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>
*</asp:RequiredFieldValidator> <asp:CompareValidator id=&quot;CompareValidatorPASSWORD2&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;PASSWORD&quot;>
Password fields don't match</asp:CompareValidator> </td>
</tr>
onSubmit=&quot;return validatePwd()&quot;
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;><br>
Enter your Email address:</td>
<td class=&quot;body&quot;><br> <asp:TextBox id=&quot;EMAIL&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;EMAILReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Email. &quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>*</asp:RequiredFieldValidator> <asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Email. &quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ValidationExpression=&quot;^[\w-]+@[\w-]+\.(com|net|org|edu|mil)$&quot;>Not a valid e-mail address. Must follow email@host.domain</asp:RegularExpressionValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;>Confirm Email address:</td>
<td class=&quot;body&quot;><asp:TextBox id=&quot;EMAIL2&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;EMAIL2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>*</asp:RequiredFieldValidator> <asp:CompareValidator id=&quot;CompareValidatorEMAIL2&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;EMAIL&quot;>Email fields don't match.</asp:CompareValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td>&nbsp;</td>
<td><asp:Button id=&quot;Button1&quot; onclick=&quot;Button1_Click&quot; runat=&quot;server&quot; Text=&quot;Register&quot;></asp:Button></td>
</tr>
</table>
</form>
 
EDIT OF ORIGINAL POST!!!!!!!!!!!

Here is the the actual code for the form...I posted wrong code in original post.

<form runat=&quot;server&quot; name=&quot;register&quot;>
<div align=&quot;left&quot;> </div>
<table width=&quot;100%&quot; border=&quot;0&quot;>
<tr valign=&quot;top&quot;>
<td width=&quot;27%&quot; class=&quot;body&quot;>Username:</td>
<td width=&quot;73%&quot; class=&quot;body&quot;><asp:TextBox id=&quot;MAJOR_KEY&quot; runat=&quot;server&quot;></asp:TextBox></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;><br>
Choose a Password:</td>
<td class=&quot;body&quot;><br> <asp:TextBox id=&quot;PASSWORD&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;PASSWORDReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Password. &quot; ControlToValidate=&quot;PASSWORD&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>
*</asp:RequiredFieldValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;>Confirm Password:</td>
<td class=&quot;body&quot;><asp:TextBox id=&quot;PASSWORD2&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;PASSWORD2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>
*</asp:RequiredFieldValidator> <asp:CompareValidator id=&quot;CompareValidatorPASSWORD2&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;PASSWORD&quot;>
Password fields don't match</asp:CompareValidator> </td>
<asp:RegularExpressionValidator id=&quot;RegularExpressionValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;PASSWORD2&quot; ValidationExpression=&quot;^\d{6}$&quot; Display=&quot;Static&quot;>Password must be 5 numeric digits</asp:RegularExpressionValidator>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;><br>
Enter your Email address:</td>
<td class=&quot;body&quot;><br> <asp:TextBox id=&quot;EMAIL&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;EMAILReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Email. &quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>*</asp:RequiredFieldValidator> <asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Email. &quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ValidationExpression=&quot;^[\w-]+@[\w-]+\.(com|net|org|edu|mil)$&quot;>Not a valid e-mail address. Must follow email@host.domain</asp:RegularExpressionValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;>Confirm Email address:</td>
<td class=&quot;body&quot;><asp:TextBox id=&quot;EMAIL2&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;EMAIL2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>*</asp:RequiredFieldValidator> <asp:CompareValidator id=&quot;CompareValidatorEMAIL2&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;EMAIL&quot;>Email fields don't match.</asp:CompareValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td>&nbsp;</td>
<td><asp:Button id=&quot;Button1&quot; onclick=&quot;Button1_Click&quot; runat=&quot;server&quot; Text=&quot;Register&quot;></asp:Button></td>
</tr>
</table>
</form>
 
Try this:
Code:
For numeric validation I use this RegExp and works fine for me
<asp:RegularExpressionValidator id=&quot;RegularExpressionValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;PASSWORD2&quot; ValidationExpression=&quot;\d{5}&quot; Display=&quot;Static&quot;>Password must be 5 numeric digits</asp:RegularExpressionValidator>

For email validation I use this regExp and works too
<asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Email. &quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ValidationExpression=&quot;[a-zA-Z0-9_.]*@[a-zA-Z0-9]{1,}\.[a-zA-Z.]{2,}&quot;>Not a valid e-mail address.  Must follow email@host.domain</asp:RegularExpressionValidator>
 
Thanks Joulius,

How do I make it for say 6 characters minimum...but they can be any characters, not only numeric?
 
You could try
Code:
<asp:RegularExpressionValidator id=&quot;RegularExpressionValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;PASSWORD2&quot; ValidationExpression=&quot;.{6,}&quot; Display=&quot;Static&quot;>Password must be 6 or more characters!</asp:RegularExpressionValidator>
 
Thanks Joulius,

That should work. But, I cannot test it b/c nothing else is working on this form. No matter what I enter, or even if I leave fields blank, my form submits to the DB and sends me to the 'success' page! I don't know what I've done wrong with this form. If it were working correctly, shouldn't the page return some errors before the db insert code even runs?

Can anyone take a look and try to find what I've screwed up?

Here's the revised form code with the code from Joulius:
<form runat=&quot;server&quot;>
<table width=&quot;100%&quot; border=&quot;0&quot;>
<tr valign=&quot;top&quot;>
<td width=&quot;27%&quot; class=&quot;body&quot;>USERNAME #:</td>
<td width=&quot;73%&quot; class=&quot;body&quot;><asp:TextBox id=&quot;MAJOR_KEY&quot; runat=&quot;server&quot;></asp:TextBox></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;><br>
Choose a Password:</td>
<td class=&quot;body&quot;><br> <asp:TextBox id=&quot;PASSWORD&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;PASSWORDReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Password. &quot; ControlToValidate=&quot;PASSWORD&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>
*</asp:RequiredFieldValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;>Confirm Password:</td>
<td class=&quot;body&quot;><asp:TextBox id=&quot;PASSWORD2&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;PASSWORD2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>
*</asp:RequiredFieldValidator> <asp:CompareValidator id=&quot;CompareValidatorPASSWORD2&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;PASSWORD&quot;>
Password fields don't match</asp:CompareValidator> <asp:RegularExpressionValidator id=&quot;RegularExpressionValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;PASSWORD2&quot; ValidationExpression=&quot;.{6,}&quot; Display=&quot;Static&quot;>Password must be 6 or more characters!</asp:RegularExpressionValidator> </td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;><br>
Enter your Email address:</td>
<td class=&quot;body&quot;><br> <asp:TextBox id=&quot;EMAIL&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;EMAILReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Email. &quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>*</asp:RequiredFieldValidator> <asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Email. &quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ValidationExpression=&quot;^[\w-]+@[\w-]+\.(com|net|org|edu|mil)$&quot;>Not a valid e-mail address. Must follow email@host.domain</asp:RegularExpressionValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;>Confirm Email address:</td>
<td class=&quot;body&quot;><asp:TextBox id=&quot;EMAIL2&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;EMAIL2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;>*</asp:RequiredFieldValidator> <asp:CompareValidator id=&quot;CompareValidatorEMAIL2&quot; runat=&quot;server&quot; Display=&quot;Static&quot; ErrorMessage=&quot;Re-enter Password. &quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;EMAIL&quot;>Email fields don't match.</asp:CompareValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td><br> <a href=&quot;../&quot;>Back</a></td>
<td><asp:Button id=&quot;Button1&quot; onclick=&quot;Button1_Click&quot; runat=&quot;server&quot; Text=&quot;Register&quot;></asp:Button></td>
</tr>
</table>
</form>
 
Here's what you have to correct:
Code:
<form runat=&quot;server&quot; ID=&quot;FORM_NAME&quot;>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr valign=&quot;top&quot;> 
      <td width=&quot;27%&quot; class=&quot;body&quot;>USERNAME #:</td>
      <td width=&quot;73%&quot; class=&quot;body&quot;><asp:TextBox id=&quot;MAJOR_KEY&quot; runat=&quot;server&quot;></asp:TextBox><asp:RequiredFieldValidator id=&quot;MAJOR_KEYReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;USERNAME Required.&quot; ControlToValidate=&quot;MAJOR_KEY&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator></td>
    </tr>
    <tr valign=&quot;top&quot;> 
      <td class=&quot;body&quot;><br>
        Choose a Password:</td>
      <td class=&quot;body&quot;><br> <asp:TextBox id=&quot;PASSWORD&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;PASSWORDReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;Password Required.&quot; ControlToValidate=&quot;PASSWORD&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator id=&quot;RegularExpressionValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;PASSWORD&quot; ValidationExpression=&quot;.{6,}&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;Password must be 6 or more characters!&quot;></asp:RegularExpressionValidator></td>
    </tr>
    <tr valign=&quot;top&quot;> 
      <td class=&quot;body&quot;>Confirm Password:</td>
      <td class=&quot;body&quot;><asp:TextBox id=&quot;PASSWORD2&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;PASSWORD2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;Re-enter Password.&quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator> <asp:CompareValidator id=&quot;CompareValidatorPASSWORD2&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;Password fields don't match&quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;PASSWORD&quot;></asp:CompareValidator></td>
    </tr>
    <tr valign=&quot;top&quot;> 
      <td class=&quot;body&quot;><br>
        Enter your Email address:</td>
      <td class=&quot;body&quot;><br> <asp:TextBox id=&quot;EMAIL&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;EMAILReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;Email Required.&quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator> <asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;Not a valid e-mail address.  Must follow email@host.domain&quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ValidationExpression=&quot;=&quot;[a-zA-Z0-9_.]*@[a-zA-Z0-9]{1,}\.[a-zA-Z.]{2,}&quot;></asp:RegularExpressionValidator></td>
    </tr>
    <tr valign=&quot;top&quot;> 
      <td class=&quot;body&quot;>Confirm Email address:</td>
      <td class=&quot;body&quot;><asp:TextBox id=&quot;EMAIL2&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;EMAIL2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;Email Required.&quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator> <asp:CompareValidator id=&quot;CompareValidatorEMAIL2&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;&nbsp;Email fields don't match.&quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;EMAIL&quot;></asp:CompareValidator></td>
    </tr>
    <tr valign=&quot;top&quot;> 
      <td><br> <a href=&quot;javascript:window.history.back();&quot;>Back</a></td>
      <td><asp:Button id=&quot;Button1&quot; onclick=&quot;Button1_Click&quot; runat=&quot;server&quot; Text=&quot;Register&quot;></asp:Button></td>
    </tr>
  </table>
</form>

If it still not working, then the problem is in your codebehind code, I guess.
 
That code looks great, thank you. But, there must be something wrong with my VB code, b/c it still submits successfully to the DB. The only way I get an error is if I enter an incorrect Username (we call it the NRDS number in this case), or no Username at all. Other wise I can leave all other fields blank or with incorrect info, and it still submits successfully.

Can anyone see if the VB code is causing the problem?

VB CODE:

<script runat=&quot;server&quot;>
Sub Button1_Click(sender As Object, e As EventArgs)
'store NRDS # in Session variable
Session.Contents(&quot;MAJOR_KEY&quot;) =&quot;ss&quot;' MAJOR_KEY.Text
'establish ADO.Net connection
Dim strConn As String = ConfigurationSettings.AppSettings(&quot;ConnectionString&quot;)
Dim strSql as String = &quot;SELECT MAJOR_KEY FROM webMembers WHERE (MAJOR_KEY = '&quot; + MAJOR_KEY.Text + &quot;')&quot;
Dim objConn as New SqlConnection(strConn)
Dim objCommand as New SqlCommand(strSql, objConn)
Dim objDataReader as SqlDataReader
objConn.Open() 'open the connection
'open the DataReader to access data
objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
If objDataReader.Read() = True Then 'MAJOR_KEY matches, verify again
If objDataReader(&quot;MAJOR_KEY&quot;) = MAJOR_KEY.Text Then
strSql = &quot;UPDATE webMembers SET PASSWORD = '&quot; + PASSWORD.Text + &quot;', EMAIL = '&quot; + EMAIL.Text + &quot;', ACTIVE = 'Yes' WHERE MAJOR_KEY = '&quot; + MAJOR_KEY.Text + &quot;'&quot;
objDataReader.Close()
objConn.Close()
objconn.open()
objCommand.CommandText=strSql
objCommand.CommandType=CommandType.Text
objCommand.ExecuteNonQuery()
Response.Redirect(&quot;confirmUpdate.aspx&quot;)
End If
Else
response.write (&quot;<font color=#FFFFFF><b>Your Username # is incorrect or not in our system. Please try again, or see below if you continue to have problems.</b></font>&quot;)
End If
End Sub
</script>
 
This should work now
Code:
		<form runat=&quot;server&quot; ID=&quot;FORM_NAME&quot;>
			<TABLE height=&quot;261&quot; cellSpacing=&quot;0&quot; cellPadding=&quot;0&quot; width=&quot;757&quot; border=&quot;0&quot; ms_2d_layout=&quot;TRUE&quot;>
				<TR vAlign=&quot;top&quot;>
					<TD width=&quot;10&quot; height=&quot;15&quot;></TD>
					<TD width=&quot;747&quot;></TD>
				</TR>
				<TR vAlign=&quot;top&quot;>
					<TD height=&quot;246&quot;></TD>
					<TD>
						<table width=&quot;746&quot; border=&quot;0&quot; height=&quot;245&quot;>
							<tr valign=&quot;top&quot;>
								<td width=&quot;27%&quot; class=&quot;body&quot;>USERNAME #:</td>
								<td width=&quot;73%&quot; class=&quot;body&quot;><asp:TextBox id=&quot;MAJOR_KEY&quot; runat=&quot;server&quot;></asp:TextBox><asp:RequiredFieldValidator id=&quot;MAJOR_KEYReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; USERNAME Required.&quot;
										ControlToValidate=&quot;MAJOR_KEY&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator></td>
							</tr>
							<tr valign=&quot;top&quot;>
								<td class=&quot;body&quot;><br>
									Choose a Password:</td>
								<td class=&quot;body&quot;><br>
									<asp:TextBox id=&quot;PASSWORD&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox>
									<asp:RequiredFieldValidator id=&quot;PASSWORDReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Password Required.&quot;
										ControlToValidate=&quot;PASSWORD&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
									<asp:RegularExpressionValidator id=&quot;RegularExpressionValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;PASSWORD&quot; ValidationExpression=&quot;.{6,}&quot;
										Display=&quot;Dynamic&quot; ErrorMessage=&quot; Password must be 6 or more characters!&quot;></asp:RegularExpressionValidator></td>
							</tr>
							<tr valign=&quot;top&quot;>
								<td class=&quot;body&quot;>Confirm Password:</td>
								<td class=&quot;body&quot;><asp:TextBox id=&quot;PASSWORD2&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox>
									<asp:RequiredFieldValidator id=&quot;PASSWORD2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Re-enter Password.&quot;
										ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
									<asp:CompareValidator id=&quot;CompareValidatorPASSWORD2&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Password fields don't match&quot;
										ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;PASSWORD&quot;></asp:CompareValidator></td>
							</tr>
							<tr valign=&quot;top&quot;>
								<td class=&quot;body&quot;><br>
									Enter your Email address:</td>
								<td class=&quot;body&quot;><br>
									<asp:TextBox id=&quot;EMAIL&quot; runat=&quot;server&quot;></asp:TextBox>
									<asp:RequiredFieldValidator id=&quot;EMAILReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Email Required.&quot;
										ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
									<asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Not a valid e-mail address.  Must follow email@host.domain&quot;
										ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; [COLOR=red]ValidationExpression=&quot;.{1,}\@.{1,}\.[a-zA-Z.]{2,}&quot;[/color]></asp:RegularExpressionValidator></td>
							</tr>
							<tr valign=&quot;top&quot;>
								<td class=&quot;body&quot;>Confirm Email address:</td>
								<td class=&quot;body&quot;><asp:TextBox id=&quot;EMAIL2&quot; runat=&quot;server&quot;></asp:TextBox>
									<asp:RequiredFieldValidator id=&quot;EMAIL2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Email Required.&quot;
										ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
									<asp:CompareValidator id=&quot;CompareValidatorEMAIL2&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Email fields don't match.&quot;
										ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;EMAIL&quot;></asp:CompareValidator></td>
							</tr>
							<tr valign=&quot;top&quot;>
								<td><br>
									<a href=&quot;javascript:window.history.back();&quot;>Back</a></td>
								<td><asp:Button id=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Register&quot;></asp:Button></td>
							</tr>
						</table>
					</TD>
				</TR>
			</TABLE>
		</form>

<script runat=&quot;server&quot;>
    Sub Button1_Click(sender As Object,e As EventArgs)
    'store NRDS # in Session variable
    Session.Item(&quot;NRDS&quot;) =&quot;user&quot; & MAJOR_KEY.Text
    'establish ADO.Net connection
    Dim strConn As String = ConfigurationSettings.AppSettings(&quot;ConnectionString&quot;)
    Dim strSql as String = &quot;SELECT MAJOR_KEY FROM webMembers WHERE (MAJOR_KEY = &quot; & MAJOR_KEY.Text & &quot;)&quot;
    Dim objConn as    New    SqlConnection(strConn)
    Dim objCommand as New SqlCommand(strSql, objConn)
    Dim objDataReader as SqlDataReader
     objConn.Open()  'open the connection
    'open the DataReader to access    data
     objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
    Dim cntRw as Integer
    cntRw=0
    while objDataReader.Read() 
     cntRw=cntRw+1
    end while
    if cntRw>0 then
    'MAJOR_KEY    matches, verify again
      strSql2 = &quot;UPDATE webMembers SET PASSWORD = '&quot; & PASSWORD.Text & &quot;', EMAIL = '&quot; & EMAIL.Text & &quot;', ACTIVE    = 'Yes' WHERE MAJOR_KEY = &quot; & MAJOR_KEY.Text
            objDataReader.Close() 
            objConn.Close()
            objconn.open()
            objCommand.CommandText=strSql2
            objCommand.CommandType=CommandType.Text
            objCommand.ExecuteNonQuery() 
        Response.Redirect(&quot;confirmUpdate.aspx&quot;)
     Else
        response.write (&quot;<font color=#FFFFFF><b>Your Username # is incorrect or not in our system. Please try again, or see below if you continue to have problems.</b></font>&quot;)
     End If
    End Sub
</script>

[yawn] [morning] [yawn]
 
Jeez ... isn't that damn? I must be too tired now ... what I wanted to say is to ignore the color tags here
Code:
<asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Not a valid e-mail address.  Must follow email@host.domain&quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; [COLOR=red]ValidationExpression=&quot;.{1,}\@.{1,}\.[a-zA-Z.]{2,}&quot;[/color]></asp:RegularExpressionValidator>

[yawn] [morning] [yawn]
 
Joulius, Thanks for all of your help with this. All of the form verification code seems to be correct now. However, the page still does not work correctly. If I enter a non-existing NRDS number (username) and then some incorrect stuff for password and email, I get all the appropriate errors that I should get. But, if I enter an existing NRDS number, and some incorrect stuff for the other fields, the form submits successfully to the DB.

There must still be something wrong with the code. For some reason, as long as the NRDS is in the DB, it ignores everything else.

Here is the exact code for the entire page as I have it. Perhaps you or someone can figure out what's wrong...I can't see it.

<%@ Page Language=&quot;VB&quot; %>
<%@ import Namespace=&quot;System.Data&quot; %>
<%@ import Namespace=&quot;System.Data.SqlClient&quot; %>
<script runat=&quot;server&quot;>
Sub Button1_Click(sender As Object,e As EventArgs)
'store NRDS # in Session variable
Session.Item(&quot;NRDS&quot;) =&quot;user&quot; ' MAJOR_KEY.Text
'establish ADO.Net connection
Dim strConn As String = ConfigurationSettings.AppSettings(&quot;ConnectionString&quot;)
Dim strSql as String = &quot;SELECT MAJOR_KEY FROM webMembers WHERE (MAJOR_KEY = &quot; & MAJOR_KEY.Text & &quot;)&quot;
Dim objConn as New SqlConnection(strConn)
Dim objCommand as New SqlCommand(strSql, objConn)
Dim objDataReader as SqlDataReader
objConn.Open() 'open the connection
'open the DataReader to access data
objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
Dim cntRw as Integer
cntRw=0
while objDataReader.Read()
cntRw=cntRw+1
end while
if cntRw>0 then
'MAJOR_KEY matches, verify again
strSql = &quot;UPDATE webMembers SET PASSWORD = '&quot; & PASSWORD.Text & &quot;', EMAIL = '&quot; & EMAIL.Text & &quot;', ACTIVE = 'Yes' WHERE MAJOR_KEY = &quot; & MAJOR_KEY.Text
objDataReader.Close()
objConn.Close()
objconn.open()
objCommand.CommandText=strSql
objCommand.CommandType=CommandType.Text
objCommand.ExecuteNonQuery()
Response.Redirect(&quot;confirmUpdate.aspx&quot;)
Else
response.write (&quot;<font color=#FFFFFF><b>Your NRDS # is incorrect or not in our system. Please try again, or see below if you continue to have problems.</b></font>&quot;)
End If
End Sub
</script>
<html>
<head>
<title>Member Registration</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; />
<link href=&quot;../Library/default.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; />
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!--
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function tmt_lenValidator(f,sp,ep,ks,eMsg){
var str;var myErr=&quot;&quot;;var re=/^(\s*)$/;fv=MM_findObj(f).value;
if(ks){if(re.test(fv)){fv=fv.replace(re,&quot;&quot;);}}
if(fv.length<sp||fv.length>ep){alert(unescape(eMsg));myErr += 'eMsg';}
document.MM_returnValue=(myErr==&quot;&quot;);
}
//-->
</script>
</head>
<body bgcolor=&quot;#006699&quot; leftmargin=&quot;60&quot; topmargin=&quot;60&quot;>
<table height=&quot;100%&quot; cellpadding=&quot;1&quot; width=&quot;100%&quot; align=&quot;center&quot; border=&quot;0&quot;>
<tbody>
<tr>
<td valign=&quot;center&quot; align=&quot;middle&quot; bgcolor=&quot;#cccccc&quot; height=&quot;568&quot;> <table height=&quot;412&quot; cellpadding=&quot;5&quot; width=&quot;600&quot; align=&quot;center&quot; bgcolor=&quot;#cccccc&quot; border=&quot;0&quot;>
<tbody>
<tr>
<td valign=&quot;center&quot; align=&quot;middle&quot; bgcolor=&quot;#ffffff&quot; height=&quot;408&quot;>
<form runat=&quot;server&quot; ID=&quot;FORM_NAME&quot;>
<div align=&quot;left&quot;><img height=&quot;100&quot; src=&quot;../images/header_sm.gif&quot; width=&quot;300&quot; />
</div>
<table width=&quot;100%&quot; border=&quot;0&quot;>
<tr valign=&quot;top&quot;>
<td height=&quot;19&quot; colspan=&quot;2&quot; class=&quot;title&quot;>Member Registration</td>
</tr>
<tr valign=&quot;top&quot;>
<td height=&quot;19&quot; colspan=&quot;2&quot; class=&quot;body&quot;> You must register
to gain access to this site. To register, please enter
the requested information in the fields below.<br>
<br> </td>
</tr>
<tr valign=&quot;top&quot;>
<td width=&quot;27%&quot; class=&quot;body&quot;>NRDS #:</td>
<td width=&quot;73%&quot; class=&quot;body&quot;><asp:TextBox id=&quot;MAJOR_KEY&quot; runat=&quot;server&quot;></asp:TextBox>
<asp:RequiredFieldValidator id=&quot;MAJOR_KEYReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; NRDS Required. &quot; ControlToValidate=&quot;MAJOR_KEY&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;><br>
Choose a Password:</td>
<td class=&quot;body&quot;><br><asp:TextBox id=&quot;PASSWORD&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox>
<asp:RequiredFieldValidator id=&quot;PASSWORDReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Password Required.&quot; ControlToValidate=&quot;PASSWORD&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator id=&quot;RegularExpressionValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;PASSWORD&quot; ValidationExpression=&quot;.{6,}&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Password must be 6 or more characters!&quot;></asp:RegularExpressionValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;>Confirm Password:</td>
<td class=&quot;body&quot;><asp:TextBox id=&quot;PASSWORD2&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox>
<asp:RequiredFieldValidator id=&quot;PASSWORD2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Re-enter Password.&quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
<asp:CompareValidator id=&quot;CompareValidatorPASSWORD2&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Password fields don't match&quot; ControlToValidate=&quot;PASSWORD2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;PASSWORD&quot;></asp:CompareValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;><br>
Enter your Email address:</td>
<td class=&quot;body&quot;><br><asp:TextBox id=&quot;EMAIL&quot; runat=&quot;server&quot;></asp:TextBox>
<asp:RequiredFieldValidator id=&quot;EMAILReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Email Required.&quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Not a valid e-mail address. Must follow email@host.domain&quot; ControlToValidate=&quot;EMAIL&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ValidationExpression=&quot;.{1,}\@.{1,}\.[a-zA-Z.]{2,}&quot;></asp:RegularExpressionValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td class=&quot;body&quot;>Confirm Email address:</td>
<td class=&quot;body&quot;><asp:TextBox id=&quot;EMAIL2&quot; runat=&quot;server&quot;></asp:TextBox>
<asp:RequiredFieldValidator id=&quot;EMAIL2ReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Email Required.&quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;12&quot; Font-Name=&quot;Verdana&quot;></asp:RequiredFieldValidator>
<asp:CompareValidator id=&quot;CompareValidatorEMAIL2&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot; Email fields don't match.&quot; ControlToValidate=&quot;EMAIL2&quot; Font-Size=&quot;11&quot; Font-Name=&quot;Arial&quot; ControlToCompare=&quot;EMAIL&quot;></asp:CompareValidator></td>
</tr>
<tr valign=&quot;top&quot;>
<td><br>
<a href=&quot;../&quot;>Back</a></td>
<td><asp:Button id=&quot;Button1&quot; onclick=&quot;Button1_Click&quot; runat=&quot;server&quot; Text=&quot;Register&quot;></asp:Button></td>
</tr>
<tr valign=&quot;top&quot;>
<td colspan=&quot;2&quot; class=&quot;body&quot;><br>
</td>
</tr>
</table>
</form></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</body>
</html>
 
What's with this code?
Code:
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!--
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function tmt_lenValidator(f,sp,ep,ks,eMsg){
    var str;var myErr=&quot;&quot;;var re=/^(\s*)$/;fv=MM_findObj(f).value;
    if(ks){if(re.test(fv)){fv=fv.replace(re,&quot;&quot;);}}
    if(fv.length<sp||fv.length>ep){alert(unescape(eMsg));myErr += 'eMsg';}
    document.MM_returnValue=(myErr==&quot;&quot;);
}
//-->
</script>
and try removing this line
Code:
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; />
MAke sure you have the WebUIValidation.js file in your web root \aspnet_client\system_web\{Framework version}

[yawn] [morning] [yawn]
 
I contacted my web host and they said that the file is on there server in the following location:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\ASP.NETClientFiles\WebUIValidation.js

Since this is a web host I have no control over where the file is located, but I assume they have it mapped so that it works the same.

I took out the suspect javascript and meta tags. Still having same problem.
 
I just realised one thing ... you are saying that when you are entering a &quot;non-existing NRDS number (username)&quot;, all the appropriate errors that you should get appear. What errors? The form validation errors (&quot;Password must be 6 or more characters&quot;, &quot;Not a valid e-mail address&quot; etc) or the NRDS error check (&quot;Your NRDS # is incorrect or not in our system. Please try again, or see below if you continue to have problems&quot;)?
 
I get all of those the form errors and the NRDS error.
 
Could you try something for me please?
Make the following page.aspx (just copy this code and save it into a page.aspx file):
Code:
<%@ Page Language=&quot;vb&quot; %>
<script language=vb runat=server>
Sub btnSubmit_Click(byval sender as object, byval e as eventargs)
 if txtUser.Text=&quot;test&quot; then
  Response.Write(&quot;Your user is &quot; & txtUser.Text & &quot; and your email is &quot; & txtEmail.Text)
 else
  Response.Write(&quot;You must enter the word test for User!&quot;)
 end if
End Sub
</script>
<html>
<head>
</head>
<body>
<form id=&quot;Form1&quot; runat=server>
<table>
 <tr>
  <td>User:</td>
  <td>
   <asp:TextBox id=&quot;txtUser&quot; runat=&quot;server&quot;></asp:TextBox>
   <asp:RequiredFieldValidator id=&quot;USERReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;User Required.&quot; ControlToValidate=&quot;txtUser&quot;></asp:RequiredFieldValidator>
  </td>
 </tr>
 <tr>
  <td>Email:</td>
  <td>
   <asp:TextBox id=&quot;txtEmail&quot; runat=&quot;server&quot;></asp:TextBox>
   <asp:RequiredFieldValidator id=&quot;EMAILReqVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Email Required.&quot; ControlToValidate=&quot;txtEmail&quot;></asp:RequiredFieldValidator>
   <asp:RegularExpressionValidator id=&quot;EMAILRegexVal&quot; runat=&quot;server&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Not a valid e-mail address.  Must follow email@host.domain&quot; ControlToValidate=&quot;txtEmail&quot;  ValidationExpression=&quot;.{1,}\@.{1,}\.[a-zA-Z.]{2,}&quot;></asp:RegularExpressionValidator>
  </td>
 </tr>
 <tr>
  <td>
   <asp:Button id=&quot;btnSubmit&quot; runat=&quot;server&quot; Text=&quot;Submit&quot; OnClick=&quot;btnSubmit_Click&quot;></asp:Button>
  </td>
 </tr>
</table>
</form>
</body>
</html>
It should work this way: if you click on submit button without entering any text into those textboxes, or entering an invalid email format, it should fire up those validation errors.
If this doesn't work then it's a problem with your hosting server validation.
 
Joulius,

I test page.aspx on my host and it worked properly. So the hosting server must be okay.

There seems to be something about my VB code that causes it to ignore the form validation if the NRDS number is correct.

I'm stumped. Any other ideas?
 
Move the
Code:
<form>
tag right below the
Code:
<body>
tag and the
Code:
</form>
right above the
Code:
</body>
tag, so this way the
Code:
<table>
tag to be included within the form.

Off-topic: Why didn't you used
Code:
<asp:table>
control?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top