How to link a submit button to another webpage using HTML?


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.

To link a submit button to another webpage, use the form action attribute. Add the link in the attribute, for example − <form action=”/new.php”>

Example

You can try to run the following code to link a submit button to another webpage −

<!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">
      </form>
   </body>
</html>

Sharon Christine
Sharon Christine

An investment in knowledge pays the best interest

Updated on: 15-Jun-2020

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements