What I'm posting here is not exactly a great solution necessarily (javascript is definitly ideal in terms of a users experience and programing logic) but as an additional option or alternative if you don't want to mess with javascript or you need more flexibility with error messages, etc you can check if the boxes are empty on your submit page and redirect them back to the original page if they are empty.
So your submit page would have (assuming BOTH text boxes are blank when you send them back:
-
-
dim FirstText, SecondText
-
-
FirstText = request.form("txtBox1")
-
SecondText = request.form("txtBox2")
-
-
If FirstText = "" then
-
If SecondText = "" then 'send them back
-
resposnse.redirect("SearchPage.asp?err=Blanks")
-
end if
-
end if
-
-
Then on your original search page you use the err variable to display a message
-
-
if request.querystring("err") <> "" then
-
response.write "Fields cannot be blank!!"
-
end if
-
-
To go a step further for anyone else too, you can pass your user filled data back and forth either in session objects or querystrings if you want to be able to retain the data the user entered on the search page (ie return them to the page with the form filled out rather then clearing it out again)