Reputation: 113
I can connect to another html page by using the following code by using a button click.
<form action="where-you-want-to-go"><input type="submit"></form>
but I have a problem. When there are two buttons on the page how can I redirect them to two different pages by using this code? Or is there any other way to do that?
Upvotes: 3
Views: 43178
Reputation: 3621
YOU COULD DO something like this
<input type="button" onclick="window.location = 'where-you-want-to-go';">
<input type="button" onclick="window.location = 'where-you-want-to-go';">
Upvotes: 7
Reputation: 614
What do you mean by "redirect"? After clicking submit button the form data is send to action url. If you want you can create two forms:
<form action="action-first"><input type="submit"></form>
<form action="action-second"><input type="submit"></form>
But if you don't want to send data, you can use links to go to the page:
<a href="/action-first">First link</a>
<a href="/action-second">Second link</a>
Upvotes: 2