Can someone please tell me how I add an arror message to an ASP page when the user submits an empty page?
I know Javascript would work but I've never used it before so was wondering if there was some html/asp way of doing it?
At the moment when the page is submitted blank it goes to another page which displays the error message, however I have lots of response objects on there so I also get an error when it carries on reading the code. I want it to just stop after the error message and go back to the original submit page.
See code below:
Thanks.
If Request.QueryString("StaffNo")="" then
Response.Write "You must enter your staff number or select your surname."
Else
strSQL = "SELECT * from Staff, Validation where staff.staffno = validation.staffno and staff.staffno = '" & Request.QueryString("StaffNo") & "'"
End If
GetConnection
Set objRS = CreateObject("ADODB.Recordset")
objRS.Open strSQL, Conn
%>
<input type="text" value="<%=objRS("LName")%>" name="LName">
<input type="text" value="<%=objRs("FName")%>" name="FName">
<input type="text" value="<%=objRS("StaffNo")%>" name="StaffNo"><p>
<input type="text" value="<%=objRS("Location")%>" name="Location">
<input type="text" value="<%=objRS("ManagerNo")%>" name="ManagerNo"><p>
<input type="text" value="<%=objRS("CourseKey")%>" name="CourseKey">
<input type="text" value="<%=objRS("CourseDate")%>" name="CourseDate">
<input type="text" value="<%=objRS("TrainerNo")%>" name="TrainerNo">
<%
I know Javascript would work but I've never used it before so was wondering if there was some html/asp way of doing it?
At the moment when the page is submitted blank it goes to another page which displays the error message, however I have lots of response objects on there so I also get an error when it carries on reading the code. I want it to just stop after the error message and go back to the original submit page.
See code below:
Thanks.
If Request.QueryString("StaffNo")="" then
Response.Write "You must enter your staff number or select your surname."
Else
strSQL = "SELECT * from Staff, Validation where staff.staffno = validation.staffno and staff.staffno = '" & Request.QueryString("StaffNo") & "'"
End If
GetConnection
Set objRS = CreateObject("ADODB.Recordset")
objRS.Open strSQL, Conn
%>
<input type="text" value="<%=objRS("LName")%>" name="LName">
<input type="text" value="<%=objRs("FName")%>" name="FName">
<input type="text" value="<%=objRS("StaffNo")%>" name="StaffNo"><p>
<input type="text" value="<%=objRS("Location")%>" name="Location">
<input type="text" value="<%=objRS("ManagerNo")%>" name="ManagerNo"><p>
<input type="text" value="<%=objRS("CourseKey")%>" name="CourseKey">
<input type="text" value="<%=objRS("CourseDate")%>" name="CourseDate">
<input type="text" value="<%=objRS("TrainerNo")%>" name="TrainerNo">
<%