Advertisement
Guest User

Untitled

a guest
Jun 17th, 2015
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function(){
  2.    
  3.     //code below will be executed when the submit button being clicked
  4.     $('form.appnitro').submit(function() {
  5.      
  6.       if($("#element_1").val() != "xyz"){
  7.  
  8.         $("#element_1").parentsUntil("ul").last().addClass("error").append('<p class="error">Incorrect text entered!</p>');
  9.        
  10.         //restore the submit button
  11.         $("#li_buttons > input[type=submit],#li_buttons > input[type=image]").prop("disabled",false);
  12.  
  13.         //cancel the form submission
  14.         return false;
  15.       }
  16.     });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement