I have a requirement that if the yes/no check box column is checked then user dont need to fill the document name if it is not checked user should fill the document name so for that i using this presave action in the new form let me know what is wrong in this code i am not able to figure out.
function PreSaveAction() {
var drpSection = $("select[title='Process']").val();
var drpDocumentName = $("select[title='Document Name']").val();
var drpDocumentNo = $("select[title='Document No']").val();
var drpRegional = $('input[type="checkbox"][name="Regional Document"]').val();
if(drpSection == '0'){
alert("Please enter a Process");
return false;
}
else if(drpDocumentName == '0' && drpRegional == 'No'){
alert("Please enter a Document Name");
return false;
}
else if(drpDocumentNo == '0'){
alert("Please enter a Document No.");
return false;
}
else if(drpRegional == 'Yes' && drpDocumentName == '0'){
return true;
}
}