If Then Else

E

Erin

Hi,
On a link that I send users via email I have a code number on the end that
populates a field on the page and that number is fed into a database when the
user clicks the submit button. Properties of this button is "Push Button" &
"Submit" type.

http://www.xxxx.com/survey/users_interface/Results/submission_form.asp?snumber=134

What I want to do is to code the submission_form.asp so that if snumber is
greater than 400 then when the submit button is clicked, I want it to open
http://www.xxxx.com/survey/executive_interface/Results/survey.asp
otherwise I want it to automatically open
http://www.xxxx.com/survey/departmental_interface/Results/survey.asp

I really need help and I need to know exactly where to put the code.
 
J

Jon Spivey

Hi,
You could set the action of the form from the number, eg

<%
iNumber = cint(request.querystring("snumber"))
if iNumber > 400 then
sAction = "/survey/executive_interface/Results/survey.asp"
else
sAction = "/survey/departmental_interface/Results/survey.asp"
end if
%>
<form action = "<%=sAction%>" method="post">
 

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

Top