HTML Forms

What is a form?

The form is used to take values or data from the user and to send the data for storage in the database.

Text:

<html>
<body><form>
1st name<input type=”text” name=”1stname” value=”Sameed”>
<br>
Second name<input type=”text” name=”secondname” value=” “>
<br>
<input type=”submit” value=”Submit”>
</form></body></html>

Output:

text in html form

You can also apply input type as “password”. If you write it as follows;

<input type=”password” > 

it will create the text box  but all typed values are hidden and does not appears on the screen. Instead stars * are appears on the screen.


Radio Button:

<html>
<body><form>
<input type=”radio” value=”male” name=”gender”  > Male<br>
<input type=”radio” value=”female” name=”gender”  checked> Female<br>
</form></body>
</html>

Output:

radion button in html


Text Area:

A larger text area can also be defined to get a large message

<html>
<body><form>
<textarea name=”message”  cols=”10″ rows=”5″ >Welcome to T4Tutorials.com</textarea> <br>
<input type=”submit”>
</form></body>
</html>

Output: 

textarea in html

Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....
https://web.facebook.com/groups/2066136233601097/

Leave a Reply