Lenotre
Lenotre

Reputation: 53

Password input with custom button

I am currently trying to add my own login button to my password box and I can't get them to link together. I'd appreciate any help on Password Inputs and custom buttons.

Here is my password input:

<label class="hidden-label" for="Passwd"></label>
<input id="Passwd" name=" Passwd" type="password" placeholder=" Password" 
   class="" style="width: 275px; height: 43px;"/>

And here is my button:

<a href="login.php" class="button blue" >Sign in</a>

I am also using CSS to make it look like I want it to.

Upvotes: 1

Views: 632

Answers (1)

Mr.Web
Mr.Web

Reputation: 7154

In order to pass the data from your password field to the login page, you are to wrap your label and input inside a form with the attribute action="login.php".

The button should either be a <button> or an input with type="submit".

Otherwise there is no way for your code to tell to pass data to the login.php page.

<form action="login.php">
    <label class="hidden-label" for="Passwd"></label>
    <input id="Passwd" name=" Passwd" type="password" placeholder=" Password" class="" style="width: 275px; height: 43px;"/>
    <input type="submit" value="Sign in" class="button blue">
</form>

Fore more infos read this: W3schools Forms

Upvotes: 1

Related Questions