Log in

View Full Version : how to define action in form



gul
06-07-2010, 11:13 PM
I have designed a form to contact me , now i want to get this information but i dont understand how to make action for this form means where to put any script file , how to get it done???

djr33
06-08-2010, 12:35 AM
An "action" of a form is the thing it "does". It's just like the href of an <a> tag for a link: it's a url where the form goes. But unlike just a regular link, the form also sends the data to this page:
<form method="get OR post" action="wherethisgoes.url">

Then on that next page you'll use some serverside language to do stuff with the data, such as using PHP to send an email. Or you can point this to a third party website and they'll handle it for you (google "free form mailer"). You can also use action="mailto:your@email.com", but that will just open the user's email program with the data from the form: I highly recommend against this option.