Skip to main content

Posts

Showing posts from March, 2012

How to Submit a Form Using Jquery

Demo Code <script src= "http://code.jquery.com/jquery-latest.js" ></script> <form action= "#" target= "_blank" > <input type= "text" /> <input type= "submit" /> </form> <span style= "color:red;" id= 'alert' ></span> <script> $( "form" ).submit( function () { if ($( "input:first" ).val() != "" ) return true ; $( "#alert" ).text( "Empty Text Box!!" ).show().fadeOut( 1500 ); return false ; }); </script>