Solution 1 :

where the <form> tag is, inside of the action attribute, instead of ‘login.php’ you need to put the ‘https://www.otherwebsite.com’.

Note: the submit input is NOT where you put the link you’re going to.

Solution 2 :

I think the button should not redirect to another webpage but instead put a redirect webpage after authentication in login.php. you can check this for the tutorial link

Problem :

How do I make the login button directly to another website? I am doing this for my small business and need help. What do people need to log in? I have already completed a registration form. I would really appreciate the help.

function check(form)
{

if(form.userid.value == "person" && form.pwd.value == "WachtWoord")
{
    return true;
}
else
{
    alert("Error Password or Username")
    return false;
}
}
<html>

<body>
<form name="loginForm" method="post" action="login.php">
<table width="20%" bgcolor="ffffff" align="left">


<tr>
<td>Username:</td>
<td><input type="text" size=25 name="userid"></td>
</tr>

<tr>
<td>Password:</td>
<td><input type="Password" size=25 name="pwd"></td>
</tr>

<tr>
<td><input type="submit" onclick="location.website = 'https://www.otherwebsite.com';"></td>
</tr>

</table>
</form>


</body>
</html>
```

Comments

Comment posted by stackoverflow.com/questions/503093/…

Look up window.location.href:

Comment posted by Jon P

If this is the login form you don’t want the button redirecting to another web page. You want to process the form, login.php by the look of it, the logic of that page should then redirect based on the result of the login

Comment posted by esqew

By