Click to See Complete Forum and Search --> : A little ASP VooDoo


programmerfreak
11-03-2005, 05:11 PM
Hello,

I'm trying to create a custom feedback form, tailored to fit my office Intranet site. I'm pretty sure the form itself works, it's just parts of the error detection don't apply themselves at the right time.

E.X.:

I have a set of detection rules that I coded by hand that tell the user what they need to provide for the feedback to be sent, after clicking submit. The problem is that I have this part of the page set above the actual form in an If statement, and when the page loads, even if the user didn't submit the form, it gives an error followed by what they need to put into the form.

I don't want to confuse the user with this, and was wondering if there is a way to set some sort of cookie/variable/session hybrid to tell if this is the first time the page has been loaded (so it won't display any errors, just the form) of if the user has submitted the form (so it will either give them an error, or continue along with sending the data to me).

I can make my code available upon request. I'm running everything from one ASP page (form, detection, email validation, submission). This is my second shot at creating the this form...My first shot kind of pooped out on me (It would work on my testbed server, then when I made it live, it would just give an error).

Thanks in advance,
Mike

silverbullet24
11-03-2005, 07:11 PM
what about something simple like

%>
if request.form("submit") <> "" then
detection rules here
end if
%>

buntine
11-03-2005, 08:12 PM
SilverBullet's suggestion should work fine. Just name the submit button on your form "submit" (or alter the code to fit your naming convention).

Regards.

programmerfreak
11-08-2005, 04:35 PM
Thanks all. I'm pretty new to ASP... :rolleyes: I used to program PHP, but the syntax is not really all that close between the two. :p

Thanks again.

Bullschmidt
11-10-2005, 02:36 PM
The problem is that I have this part of the page set above the actual form in an If statement, and when the page loads, even if the user didn't submit the form, it gives an error followed by what they need to put into the form.


And here's a related link:

Classic ASP Design Tips - Post Back Page
http://www.bullschmidt.com/devtip-postbackpage.asp