- function formsubmit(){
- var ammount = $('#ammount').val();
- var emp_status = $("input[name='empstatus']:checked").val()?$("input[name='empstatus']:checked").val():'undefined';
- var com_name = $('#com_name').val();
- var ann_inc=$('#ann_inc').val();
- var city=$('#city').val();
- var emi_paid = $("input[name='emi_paid']:checked").val()?$("input[name='emi_paid']:checked").val():'undefined';
-
- flag = true;
- if (ammount.trim()=='') {
- $('#msgammount').css('color','red');
- $('#msgammount').text('Please Enter Price');
- $('#msgammount').show();
- return false;
- }
- if (emp_status == 'undefined') {
- $('#msgempstatus').css('color','red');
- $('#msgempstatus').text('Please Enter Price');
- $('#msgempstatus').show();
- return false;
- }
- if (emi_paid == 'undefined') {
- alert('undefined');
- return false;
- }
- }
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.