Sandeep Banerjee

Sandeep Banerjee

  • NA
  • 249
  • 264k

how to keep validation off in jquery

Oct 19 2017 10:10 PM
  1. function formsubmit(){  
  2.     var ammount = $('#ammount').val();  
  3.     var emp_status = $("input[name='empstatus']:checked").val()?$("input[name='empstatus']:checked").val():'undefined';  
  4.     var com_name = $('#com_name').val();  
  5.     var ann_inc=$('#ann_inc').val();  
  6.     var city=$('#city').val();  
  7.     var emi_paid =  $("input[name='emi_paid']:checked").val()?$("input[name='emi_paid']:checked").val():'undefined';  
  8.   
  9.     flag = true;  
  10.     if (ammount.trim()=='') {  
  11.         $('#msgammount').css('color','red');  
  12.         $('#msgammount').text('Please Enter Price');  
  13.         $('#msgammount').show();  
  14.         return false;  
  15.     }  
  16.     if (emp_status == 'undefined') {  
  17.         $('#msgempstatus').css('color','red');  
  18.         $('#msgempstatus').text('Please Enter Price');  
  19.         $('#msgempstatus').show();  
  20.         return false;  
  21.     }  
  22.     if (emi_paid == 'undefined') {  
  23.         alert('undefined');  
  24.         return false;  
  25.     }  
  26. }  

I want to hide the error emi_paid section as some of the user not going to fill emi_details if they not took any loan from bank, so i am using radio button if user has any existing loan then only emi option appear,

my code run well the only thing disappoint me to hide the emi_paid error, it will show always at the time of form submission.


Answers (1)