ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code


Servers / Setup
Host Reviews
Server Setup
Error Tips


Contract ASP
Development

Search For:


Intro to ASP


 


Using ASP to Process Forms



ASP is perfect for processing forms of all kinds, from polls to mail forms to guestbooks and much more. Here are instructions on having ASP get information from a form.

First, of course, you need the form set up. A form is a regular HTML statement, so visit the BellaOnline HTML Site if you don't understand HTML forms. Let's do a simple yes/no poll. So the syntax for the poll form would be:

<B>Should Chocolate Be Banned?</B>
<form action="polls_p.asp" method="post">
<input type="radio" name="vote" value="YES"> YES
<input type="radio" name="vote" value="NO"> NO
<input type="submit" name="Vote!" value="Vote!">
</form>

OK, you have your form, and it points to polls_p.asp for its processing. Now you want to build your polls_p.asp page to actually do something with this user's vote.

So the very first thing you have to do is get whatever choice they made! You do that with the REQUEST command. The name of the field is vote. So all you do is say

Vote = Request("vote")

That's it! Now you have a variable called Vote, and in it is either YES or NO. It's just a matter of using that with your database commands! You can do that with as many fields as you wish, so your form could have say 20 fields and be a complex application form. You just REQUEST each field one by one and put each into a variable.

Inserting Into a Database with ASP
Updating a Database with ASP

ASP Form Creation and Security

Bookmark this site so you can reference it any time you have ASP questions in the future!




ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2012 Minerva WebWorks LLC. All rights reserved.

Irish Wedding


Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error