join: new@juude



get alerts for new articles






CLOSE WINDOW

join: new@juude



get alerts for new articles






CLOSE WINDOW
html5

The Form - Server Side


You do not have to know server side scripting in order to create a form with a server-side response. In this case we are going to use php.

You need to create a page with a form and a page for the reply. The reply page will load into the browser and an email will be sent as soon as the user submits the form.

First create a form, we will address the action to "name.php". As this is a very simple form I am not going to include a fieldset.

Matching the server-side script. You need to have elements within the form that match the php script. You need to use the "name" attribute. In the example I have used:
name="name"
name="email"
name="comments"

The property of the "name" attribute will show up in the email.


Include required for all elements that the user must fill-out.
<form id="myForm" method="post" action="address.php">

<label>Subject</label>
<input type="text" name="subject" required>
<label>
Name</label>
<input type="text" name="name" required>
<label>
Email</label>
<input type="email" name="email" required>
<label>
Your Comments</label>
<textareatype="text" name="comments" required> </textarea>
<input type="submit" name="submit" id="submit" value="SUBMIT" />
</form>

Below is the form that matches the above code












go to top of page