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") ;
}
}
);
});
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 243
you need to EXPLICITLY compare 'promo99' against something as well:
($("#package option:selected").val() != '99' || $("#package option:selected").val()!='promo99')
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 243