当文本框中包含数据时禁用按钮

I see so many people ask to disable a button when a textbox is empty . how about disable a button when a textbox has data ?

this is my button code

<input type="submit" name="submit" value="Reserve" />

this is my textbox code

Name : <br><br><input type="text" name="name" value="<?php echo $name;?>"     <?php if($name != "") echo "readonly"?> /> <br><br>

Name : <br><br><input type="text" name="name2" value="<?php echo $name2;?>" <?php if($name2 != "") echo "readonly"?> /> <br><br>
<input type="submit" name="submit" value="Reserve" <?php echo ($name != "")?"disabled":""; ?>/> 

Using jQuery

$(":input").bind('keyup mouseup',function(){   
    disable_button();
});

function disable_button()
{
    flag = false;
    $(":input").each(function(){
       if($(this).val()==""){
          flag=true;
       }
   });
   if(flag){
      $("input[type=submit]").prop("disabled",false);
   }
   else
   {
     $("input[type=submit]").prop("disabled",true);
  } 
}

Demo