You are currently doing:
if( conditions )
{
...
required: true
...
}
If you look closer at your working example, your required is NOT true|false, it is a reference to a function that returns true or false. So, instead of what you have (and is not working) put your conditions in an anonymous function and assign that anonymous function to required:
$(".yearly_ns").each(function() {
$(this).rules( "add"
,{ required: function(){
return (''+$("input[name='package']").val() != '99' && $("input[name='nameserver_setup']:checked").val() == "SET") ;
}
}
);
});
Reputation Points: 116
Solved Threads: 243
Veteran Poster
Offline 1,123 posts
since Dec 2007