Remember Me button (not checkbox)

Jemz

xmas tings.
Aug 6, 2013
166
17
Right, I want to create a remember me button, instead of check box so if the button is selected it will turn to a different colour thus returning true when they click submit.

Code:
<button type="button" class="input_button_reme">Remember Me</button>

Code:
$(".input_button_reme").click(function () {
   $(this).toggleClass("grey");
});
 

Jemz

xmas tings.
Aug 6, 2013
166
17
Oh sorry, basically nothing is wrong with it. I just need to know how would I make it so if the background color of the button is white (for example) it will return false and if the background color of the button is grey (for example) it would return true. If you get what I mean.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456
I'd say give the button a value with true/false and replace the value with jQuery just like you did with the class. So when it get's submitted, you can check the value of the button and see if it is true or false.
 

Sysode

Front-End Developer
Dec 11, 2012
1,673
848
To be totally honest, I'm not sure why you'd want to do this? It's a lot of hassle and out of the ordinary to achieve something that could be done easier?

If you're wanting to pimp our your remember me a bit more, then I'd look at something like this:
(No credit to myself for this, belongs to the original creator from CodePen).
 

Jemz

xmas tings.
Aug 6, 2013
166
17
To be totally honest, I'm not sure why you'd want to do this? It's a lot of hassle and out of the ordinary to achieve something that could be done easier?

If you're wanting to pimp our your remember me a bit more, then I'd look at something like this:
(No credit to myself for this, belongs to the original creator from CodePen).

Because, I want all the buttons to line up correctly so it looks neat.
 

Sysode

Front-End Developer
Dec 11, 2012
1,673
848
Because, I want all the buttons to line up correctly so it looks neat.
Consistency is good but in certain situations I think it's better to just make a style stand out so people instantly know what the purpose of that object is. At the moment, it all seems like buttons and it requires people to read over all this, if you stick to the generic theme of a checkbox/ something along them lines, I think it'd flow easier.

Just a personal opinion anyways, I think it'd flow better for the user.
 

Users who are viewing this thread

Top