internetguy
Technical User
ok, I have a contact form that needs validation. Basically, if an input field is blank=report error, else move on to next input field. The only problem is that it is not moving onto the next input field to check. Here is my code.
<%
If Request.Form<>"" Then
If Request.Form("email")="" Then
Response.Write("You did not enter an email, please do so")
Response.Write("<br><a href='contact.asp'>Return</a>")
ElseIf Request.Form("subject")="" Then
Response.Write("You did not enter a subject address, please do so")
Response.Write("<br><a href='contact.asp'>Return</a>")
ElseIf Request.Form("message")="" Then
Response.Write("You did not enter a message, please do so")
Response.Write("<br><a href='contact.asp'>Return</a>")
Else
Set myMail=CreateObject("CDO.Message")
myMail.Subject=Request.Form("subject")
myMail.From=Request.Form("email")
myMail.To=Request.Form("james.devan@gmail.com")
myMail.TextBody=Request.Form("message")
Request.Write("Your message has been sent, thank you")
End If
<%
If Request.Form<>"" Then
If Request.Form("email")="" Then
Response.Write("You did not enter an email, please do so")
Response.Write("<br><a href='contact.asp'>Return</a>")
ElseIf Request.Form("subject")="" Then
Response.Write("You did not enter a subject address, please do so")
Response.Write("<br><a href='contact.asp'>Return</a>")
ElseIf Request.Form("message")="" Then
Response.Write("You did not enter a message, please do so")
Response.Write("<br><a href='contact.asp'>Return</a>")
Else
Set myMail=CreateObject("CDO.Message")
myMail.Subject=Request.Form("subject")
myMail.From=Request.Form("email")
myMail.To=Request.Form("james.devan@gmail.com")
myMail.TextBody=Request.Form("message")
Request.Write("Your message has been sent, thank you")
End If