Search On Google

Saturday, December 29, 2018

HTML forms

What is html form?

form is element in html. We use form element for define form to get input data.
Form have various nested elements.

Form syntax:-

<form>
form elements will be here
</form>

Form attributes:-

1.action attribute.
2.target attribute.
3.method attribute.
4.novalidate attribute.
5.name attribute.

Form elements type and use:-

The <input> element is the most important form element.
with input element you can use multiple attribute to create multiple things.

1.<input type="text"> defines a text field.
2.<input type="password"> defines a password field.
3.<input type="radio"> defines a radio button.
4.<input type="submit"> defines a submit button to submit form.


Form example:-


<form action="/server_page.jsp" target="_blank" method="post" name="myform1" novalidate>
<input type="text" name="name" value="onlinetutorial">
<input type="password" name="password" value="">
<input type="radio" name="gender" value="male" checked> Male
<input type="radio" name="gender" value="female"> Female
<input type="submit" value="Submit">
<form>


Edit HTML Form Example in Editor

No comments:

Post a Comment

About Me

My photo
Mumbai, Maharashtra, India