FORM TAG


php tutorial

FORM TAG IN HTML

php tutorial

<form> Tag generally used to make form for user input by elements like text-box, check-box, radio button, text-area many more.

When <form> is submitted, all fields on the form being sent to given location in action attribute of <form> tag. To let the browser know where to send the content, we need to add these two kinds of attributes.

► action=url
► method="post" or method="get"

Form Tag Attribute
Form Tag AttributeDefinition
acceptit's value MIME-type for server understand and accept it's specifies a comma-seperated list of content.
accept-charsetIt's value charset and specifies list of charector encoding that server accepts.
actionit's value URL/URI, and use full for sending form element's information to backend script.
enctypeit's value MIME-type to encode the contents of form
methodget and post
get: means unsecured and minimum amount of data (in size)
post: means secured and large amount of data (in size)
nameName of form tag
novalidatespecifies that the form should not be validated when submitted

Browser Support to <table> tag : Chrome, Firefox, IE, Opera, Safari
Example

<form method="post" action="trap.php">
User Name:<input type="text" name="uid"/>
Password:<input type="password" name="pwd"/>
<input type="submit" name="submit " value="login "/>
</form>
Output
User Name
Password