
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How to use the submit button in HTML forms?
Submit button automatically submits a form on click. Using HTML forms, you can easily take user input. The <form> tag is used to get user input, by adding the form elements. Different types of form elements include text input, radio button input, submit button, etc.
Let’s learn about how to use the submit button in HTML forms. It is also created using HTML <input> tag but type attribute is set to button.
You can try to run the following code to use submit button to submit and reset a form. Under the action, attribute add the file, where you want to reach after clicking Submit button. Using get and post method, you can send the values to the PHP file added in action attribute.
Example
<!DOCTYPE html> <html> <body> <form action="/new.php"> Student Name:<br> <input type="text" name="sname"> <br> Student Subject:<br> <input type="text" name="ssubject"> <br> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </form> </body> </html>
- Related Articles
- Why do we use reset button in HTML forms?
- How to link a submit button to another webpage using HTML?
- How to use tables to structurize forms in HTML?
- How can I use multiple submit buttons in an HTML form?
- What HTML forms are and how to use them?
- How to enable and disable submit button using jQuery?
- How to submit a form in Selenium webdriver if submit button can't be identified?
- How do we use radio buttons in HTML forms?
- How do we use checkbox buttons in HTML forms?
- How to use an HTML button to call a JavaScript function?
- How to submit an HTML form using JavaScript?
- How to add a Submit button after the end of the tableview using Swift?
- JavaScript Create Submit button for form submission and another button to clear input
- How to clear all the input in HTML forms?
- How to add icons in the button in HTML?

Advertisements