required form html
snippet in html

required form html

user8274


    <form action="/action_page.php">

   <label for="username">Username:</label>
  <input type="text" 
    id="username" name="username" required>
  <input type="submit">

 </form>
 

C# form required attribute

user665

@Html.TextBoxFor(m => m.ShortName, 
new { @class = "form-control", placeholder = "short name", required="required"})