Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit to post to current asp page. 1

Status
Not open for further replies.

wassup

Technical User
Oct 3, 2000
52
GB

Is it possible to have a form with user input fields and a submit button which calls a Sub in the same ASP page.

The sub needs to use the information from the input fields.
 
Yes, you have to have the form call its own ASP page. You then check the state of a Request.Form element such as the submit button to see if the text is blank. If it is't then you know that it has called itself. See below:

Code:
if Request.Form(&quot;Submit&quot;) <> &quot;&quot; then
 'page has been called by itself  
 MySub()
end if

Hope this helps,

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Thanks this will cut down the amount of ASP pages I have to create / maintain.
:)
 
You can actually have multiple forms within the ASP page that keep calling the same page. I have had an ASP page with two forms and it called itself 3 times. You just need to give each form a different name, and make sure that the Submit buttons have different values.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top