How to redirect a html page to two other html pages using two buttons?

42,200

Solution 1

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';">

Solution 2

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>
Share:
42,200
Vbabey
Author by

Vbabey

I am engineering student who is studying software engineering. I like to be an expert on the languages like Java,C# . I like to develop algorithms to solve problems and I specially like security stuff. But I am still a beginner in Java EE so I want to be a better learner and a better programmer day by day...Stackoverflow helps me a lot.

Updated on May 28, 2020

Comments

  • Vbabey
    Vbabey almost 4 years

    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?