Sunday, 28 August 2016

HTML Input Type Submit, Reset button elements

Input Type Submit
When the submit button is clicked, the form is sent to the address specified by the url.
Attributes of Input Type Submit

  • name- specifies the name of the submit button.
  • value- specifies the label that is displayed on the submit button.
example
<!Doctype Html>
<html>
<body>
<h1>Submit Button</h1>
<form>
Username : <input type="text" name="username" value="Newuser"><br />
Password : <input type="password" name="password" value="NewPassword"><br />
<input type="submit" name="Submit" value="click here"><br/>
</form>
</body>
</html>


Input Type Reset
When the reset button is clicked, form data will be cleared.
Attributes of Input Type Reset
  • name- specifies the name of the reset button.
  • value- specifies the label that is displayed on the reset button.
 example
<!Doctype Html>
<html>
<body>
<h1>Reset Button</h1>
<form>
Username : <input type="text" name="username" ><br />
Password : <input type="password" name="password"><br />
<input type="submit" name="submit" value="Submit">&nbsp;&nbsp;
<input type="reset" name="Reset" value="click to Reset"><br/>
</form>
</body>
</html>





0 comments:

Post a Comment