Jquery Validation OnBlur of textbox

jquery

Javascript:

<script type="text/javascript">

    function checkdata() {

        $("#TextBoxesGroup :input").each(function () {
            if (!$(this).val()) {
                alert(this.val()+":Dis");
                $("#addButton").attr("disabled", "disabled");
            }
            else {
                alert(this.val() + ":Ena");
                $("#addButton").removeAttr("disabled");
            }
        });
    }

    $(document).ready(function () {
        $("#addButton").attr("disabled", "disabled");
        $("#TextBoxesGroup :input").each(function () {
            $(this).blur(function () {
                checkdata();
            });
        });
    });
</script>

Html

<div id='TextBoxesGroup'>
    <div style="float: left; width: 625px;">
        <div>
        <input type="text" name="answer" class="ahsan" />
        </div>
    </div>
</div>
<div style="clear: both;">
</div>
<div>
    <input type="button" value="Add New Row" class="qa-adbtn" id='addButton' />
</div>

Now the thing i want to do is that if user enter something in textbox(ahsan) .then add button enabled and if there is nothing in textbox onblur then add button automatically goes disabled

Best Solution

this works

    function checkdata() {
var ok = true;
        $("#TextBoxesGroup :input").each(function () {

            if (!$(this).val()) {             
               ok = false;
               return;
            }

        });
if (ok) $("#addButton").removeAttr("disabled");
else   $("#addButton").attr("disabled", "disabled");

    }

    $(document).ready(function () {
        $("#addButton").attr("disabled", "disabled");

            $("#TextBoxesGroup :input").blur(function () {
                checkdata();
            });

    });
</script>
</head>
<body>
<div id='TextBoxesGroup'>
    <div style="float: left; width: 625px;">
        <div>
        <input type="text" name="answer" class="ahsan" />
 <input type="text" name="answer" class="ahsan" />
        </div>
    </div>
</div>
<div style="clear: both;">
</div>
<div>
    <input type="button" value="Add New Row" class="qa-adbtn" id='addButton' />
</div>
</body>
</html>