0

Hi, i'm new to javascript and I'm just wondering why this isnt displaying the alert messages.. can anyone shed some light?

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {


$("#username").keyup(function(e) {
var usr = $("#username").val();
var allready= 0;
if(usr.length > 3) 
{
         allready= 1;
         $('input[type="submit"]').removeAttr('disabled'); 
} else 
    $('input[type="submit"]').attr('disabled', true);
      allready = 0;
        })

function checkdone() {

if (allready == 1)
{ $('input[type="submit"]').removeAttr('disabled'); 
alert('All ready is true');
}
else 
alert('All ready is false');
$('input[type="submit"]').attr('disabled', true);
}


window.setInterval(checkdone(), 1000);
    });
</script>
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by JorgeM
0

Since you are using JQuery in your code are you referencing the jquery library in your code somewhere: for example: <script type="text/javascript" src="jquery-1.6.1.js"></script>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.