dreamweaver training london - forms
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Dreamweaver Training and help » dreamweaver training london - Forms

dreamweaver training london - Forms

resolvedResolved · Low Priority · Version Standard

replyReply Mon 2 Jul 2007, 14:06Delegate Julie said...

Julie has attended:
Dreamweaver 8 Introduction course

Forms

How do you get a form to post, and then reload the same page?

For upcoming training course dates see: Pricing & availability

replyReply Tue 3 Jul 2007, 12:49Trainer David said...

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

replyReply Tue 3 Jul 2007, 12:56Trainer Rich said...

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

 

Dreamweaver tip:

Paragraph formatting

in Dreamweaver if you type in text and press entre you get double line spacing.

To avoid this hold down the shift key and then press Enter for a soft break

View all Dreamweaver hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard