98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Dreamweaver Training and help » dreamweaver training london - Forms
dreamweaver training london - Forms
Resolved · Low Priority · Version Standard
Julie has attended:
Dreamweaver 8 Introduction course
Forms
How do you get a form to post, and then reload the same page?
RE: Forms
Hi Julie
I trust that you found your Dreamweaver 8 course helpful.
To get your form to post and then reload to the same page, all you need to do is in the html for declaring the form you need to have it as follows:
<form name="yourname" action="thesamepage.html"
method="post">
Hope this helps
David
RE: Forms
Julie,
First of all, understand that usually a server-side file processes the form. This is usually written in a CGI (common gateway interface) language such as ASP, .NET, PHP, PERL etc.
So here are two ways to achieve your desired result:
1) Have the form in a document that can contain CGI code. eg. /form.asp. Then organise that form to be structured like this pseudo code:
a) if form has been submitted, proccess form
b) display form, with the action being the same filename (eg. form.asp)
This way, each time the document with the form is loaded, it will check if the form has been submitted (eg. a user has pressed 'submit' button). If they have, process the form (eg. send e-mail, add to database).
The form is always displayed (step b), regardless.
2) Have a separate processing file - still needs to be CGI. But after the processing, automatically redirect the user to the web page with the form on it. Pseudo code:
a) user arrives at /form.html. Form is always shown, and action is a separate processing file, eg. /process-form.asp
b) user presses 'submit' button on form, and the form values get sent to /process-form.asp
c) /process-form.asp processes the data (eg. sends e-mail, adds to database etc.)
d) the last thing /process-form.asp does is redirect the browser back to /form.html (usually using 'header' method).
In my opinion, the first method is best, as you can control everything in the one file, and can easily mark errors of required fields.
This may all sound a bit technical, but it's the only way to explain it, as forms are quite technical! If this is way out of your depth, may I respectfully recommend hiring a web developer, or contracting out to a web development company.
Hope this helps.
Regards, Rich
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Dreamweaver tip:Paragraph formattingin Dreamweaver if you type in text and press entre you get double line spacing. |