Hello guys welcome. So in this video tutorial we are going to cover a popular question
that is how to link submit button to another page in HTML. Where we will talk about these
three methods by using HTML anchor tags, by using HTML form tags, and by using JavaScript
onClick event. Now get back to our tutorial. Open your text editor and create a HTML
file with this setting. Now click the file menu and save button to save your HTML file
Choose a path where you want to save your HTML file. Let's save this HTML file in our desktop
Give it a name followed by the dot HTML extension. Now click Save
Now locate your HTML file and run it on your browser. This is the web page where we will link our submit button
Now create a new HTML file and save it at the same location where we just saved our previous
HTML file. Give it a name followed by the dot HTML extension Now save this HTML file After that in the main file we have to create a
submit button and link that submit button to another page. Get started with the HTML syntax
Now in this first method we are going to use HTML anchor tags to link our submit button
Write HTML anchor tags inside your main file and between those anchor tags starting and closing
tags we have to include our submit button. Save your main file and run it in your browser
Now our submit button is clickable but it's not linked right now
To link this submit button we have to assign our another page path inside the anchor tags
H-RF attribute. If your main and other page is present at the same location like this, then you just have
to write your file's name followed by the extension. If you aren't able to see the file extension here, then right click on your file, select
properties from there and note your files extension Now save your main file and refresh the browser
If your submit button is not working or your another page is present at different location
then you have to give the full path of your another page here
To get the full path of any file, right click on it
Select properties. Under the security tab, you can select and copy the full path from there
And in your main file, you have to paste the copied path
If this full path method is not working, then you have to add file colon triple slash before
your files path. Or if you want to link the submit button to our online website like Google, then you have
to write HTTP, column, double slash website name and the domain name
Now the second method, by using HTML form tags. To link submit button to another page using HTML forms, you have to use HTML form tags
for that. Between those HTML form tags starting and closing tags you have to include your submit button using HTML input fields where input type must be submit And by using HTML form tags action attribute we can give here the full path of another
page where we want to link our submit button. Save it and refresh the browser
Now the third and the last method by using JavaScript on Click Event
For that we have to declare our submit button first. And after that, we have to create a JavaScript function
By using JavaScript, document.location. hriff, we will rewrite our user to another page on a single button click
Between those double codes, we have to write our another page path
Then by using JavaScript onClick event inside our submit button, we will run our JavaScript function
Thank you so much for watching this video