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

HTMLWeb DevelopmentFront End Technology

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>
raja
Published on 23-Jan-2018 11:26:19
Advertisements