Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is use of required attribute in HTML?

user-image
Question added by Jayahari KV , Web Designer / Manager , C-DIT
Date Posted: 2015/03/28
Erwin Cataniag
by Erwin Cataniag , Admin Secretary / Document Clerk , SISCO

As required field validator in ASP.NET. 

MR HEMANT
by MR HEMANT , PHOTOSHOP,DESING,PHOTOGRAPER , PHOTO STUDEO

for many reasosn every lens do shoot a certain type, each lens has a specific angle of photography

Murad Bin Makhashin
by Murad Bin Makhashin , Software Developer , Dar Al Tamleek

In HTML5 required attribute was introduced to textual (if I may) input element. It will make sure a form won't submit unless that input element has value. Think about it as the required field validator in ASP.NET. Here is a simple example, the page won't submit to itself until the text box has some value 

<!doctype html>

<html>

<head>

<title>Using 'required' attribute - also 'placeholder' attribute ;)</title>

</head>

<form>

<input type="text" placeholder="enter anything" required />&nbsp;<button>Submit</button>

<form>

</html>

 

I hope this answers your question.

 

Happy coding :)

 

More Questions Like This