Use jQuery to Enable/Disable a Button based on vars

Posted by Rylea S. on Stack Overflow See other posts from Stack Overflow or by Rylea S.
Published on 2010-06-05T09:52:35Z Indexed on 2010/06/05 10:02 UTC
Read the original article Hit count: 112

Filed under:
|
|

Ok so, Im using jQuery to do username and email checks before a signup...

this sets a variable true or false depending on the response from php.

$(document).ready(function() {
                if (usr_checked == true) {
                    if (em_checked == true) {
                        $("#registerbttn").removeAttr("disabled");
                    }
                }
                else {
                    $("#registerbttn").attr("disabled", "disabled");
                }
            });

How exactly do i get it to watch those variables live?

Thanks :D

© Stack Overflow or respective owner

Related posts about php

Related posts about jQuery