...

View Full Version : nooblah question



Baleric
03-09-2006, 10:20 PM
how do i make it so that asp skips a certain code at the top of the page and then runs it when i click submit on a form, eg. have an insert record script, but only run the script after i push submit,
im thinking about

if request.querystring("code") = 1 then
"code goes here"
respsone.redirect("page.asp")

is this how its done?
thanks in advance

-baleric

Archangel
03-10-2006, 02:08 PM
You put it in a sub.

Sub DifferentPage ()
if request.querystring("code") = 1 then
"code goes here"
respsone.redirect("page.asp")
End Sub

Now...to call that code simply call the sub.

Call DifferentPage()

degsy
03-10-2006, 02:28 PM
You can do it as you posted



<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
If Request.Form("Submit") = "Submit" Then
Response.Write "you clicked Submit"
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<form name="form1" method="post" action="">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>



Do you want it with Request.Form or Request.QueryString?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum