0

I am trying to link a "Sign In" button to another page called mainpage.html.

  <!doctype html>
<html>
    <head>
        <meta charset = "utf-8">
        <title>Transport Login Form</title>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <div class="loginBox">
            <img src="user.png" class="user">
            <h2>Login To Decryption 1.0</h2>
            <form>
                <p>Email</p>
                <input type="text" name="" placeholder="Enter Email">
                <p>Password</p>
                <input type="password" name="" placeholder=".....">
                <input type="submit" value="Sign In">
                <a href="#">Forget Password</a>
            </form>
        </div>
    </body>
</html> 

At the input type "submit" and value="Sign In", I am trying to get the "Sign In" button to link to another page I have, called mainpage.html.

<input type="submit" value="Sign In">

I have tried various ways to get the button to work, but everything has failed.

Elise Rhoads
  • 9
  • 1
  • 3

3 Answers3

0

Because you need read about POST/GET if you want create working submit button with redirect. But if you need simple example without working form — use <a href="linktopage.html">

Merkelst
  • 311
  • 1
  • 9
  • Above the submit button, I added this: Go to Google, which created a simple link and that worked fine. However, when trying to get the actual Submit button to direct me to google, it does not work. – Elise Rhoads Nov 29 '17 at 03:57
0

You can use onclick like that <input type="submit" onclick="location.href='mainpage.htm';" value="Sign In" />

0

As mentioned in the comments already, and assuming that you are just designing the website for now, change the <form> line to this:

<form method="get" action="mainpage.html">

It will enable your submit button to redirect to the specified link.

vronjec
  • 259
  • 1
  • 13