0

I've got to check LIVE whether all input fields are NOT empty and if they don't: show $sucess3 box.

$('#old_pass,#pass,#pass2').bind("focus blur change keyup", function(){
if( $('#old_pass').val().length > 0 && $('pass1').val().length > 0 && $('pass2').val().length > 0) { $('#success3').show(); } else { $('#success3').hide(); }
                    }).blur();

How to do it?


It works, I've dropped '#'

if( $('#old_pass').val().length > 0 && $('#pass1').val().length > 0 && $('#pass2').val().length > 0) { $('#success3').show(); } else { $('#success3').hide(); }

ehh

  • what doesn't the code you posted do that you want it to do? You haven't made any mention of why you psoeted the code at all – charlietfl Jun 16 '14 at 03:24

1 Answers1

0

You can do like this

 <script>    
   function liveEvents()
   { 
          $('#old_pass,#pass,#pass2').unbind('focus blur change keyup').bind("focus blur change keyup", function(){
                   if($('input').val().length > 0 )
                   {
                        $('#success').show();
                   } 
                   else
                   {
                        $('#success').hide();
                   }
            });
   }
   $(document).ready(function(){
          liveEvents();
   });
</script>

Whenever you append/add dynamic content call this function liveEvents again

Niyati
  • 146
  • 10