âš ī¸ Warning âš ī¸ Deprecated Code! This video tutorial contains outdated code.
💡 If you wish to update it, any AI assistant will update the code for you in seconds.

Required Form Field Input Attribute Tutorial

Published : November 16, 2014   •   Last Edited : November 24, 2025   •   Author : Adam Khoury

Learn to apply the "required" attribute to your HTML web form fields. It pops up a tip right next to the target field that lets the user know that they are required to fill in that form field before they can proceed.

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>HTML5 Form Required Fields</h2>
<form>
User Name: <input type="text" name="uname" id="uname" required >
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>