Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is use of required attribute in HTML?

user-image
Question ajoutée par Jayahari KV , Web Designer / Manager , C-DIT
Date de publication: 2015/03/28
Erwin Cataniag
par Erwin Cataniag , Admin Secretary / Document Clerk , SISCO

As required field validator in ASP.NET. 

MR HEMANT
par 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
par 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