posabsolute/jQuery-Validation-Engine — Issue #291: Make a field required if a checkbox or radiobutton is checked
Author: paul7220
Created: 2012-03-01 17:01:28+00:00
State: open

Hi,

I'm trying to use 'funcCall' in order to check whether a field is filled or not only if a particular value of a radiobutton is selected

This is my html

and this is my callback

function checkType(field, rules, i, options){
if(field.val()==''){
if($('#type3').attr('checked')==undefined)
return options.allrules.checkType.alertText;
}

}

I've also create the rule with the alert message in my language file, but it doesn't work.
I've tried to put an alert inside

if($('#type3').attr('checked')==undefined)
{
alert('debug')
}

and after the submit it shows the alert (so it enters in the function) but I can submit the form without any errors.

Do I have to add something else inside the callback

Thank you in advance

Paolo