Asp first page load (validation) help!!!!

X

x

Im working with an ASP page, with vbscript.

I am doing a bit of data validation on the following page and sending
the users back to the previous page if the required fields are not
filled in. This works great, only the warning that the required
fields were not filled in is now showing up on the first page when you
first enter the site.

how can I stop this from occurring?

thanks
 
D

Dan Brussee

Create and look for a form element that should NOT be there when
loading the page first time.

<%
if request.form("ACT") = "SAVE" then
' Validate
end if
%>
<FORM ... >
<INPUT TYPE=HIDDEN NAME="ACT" VALUE="SAVE">
....
</FORM>

When first loading the page, the value for request.form("ACT") will be
blank. However, after submitting back to itself, it will be "SAVE".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top