Hi all - wow, great product.
I am attempting to addValidation 'required' to a date control when a radio button field is selected "No".
Field events is where I an trying to apply validation.
my code:
var ctrliDate = pageObj.getControl('Inactive');
params["value"] = this.getValue();
if (params["value"] == "No"){
confirm("Please enter the Inactive date in the Services Section.");
ctrliDate.addValidation("IsRequired");
} else {
ctrliDate.setValue('');
ctrliDate.removeValidation("IsRequired");
};
return false;
However, It does not seem to work.
The user does get the confirm prompt, however the code targeted date field does not display red , and the record can be saved without an Inactive date set.
I have tried it with and without the else* removeValidation code, no joy. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=25427&image=1&table=forumtopics' class='bbcemoticon' alt='<<' />
Should I be taking a different tack??
any input is most certainly appreciated.
{wonk}