Hi Guys,
On my add page I have a have a field call "qualifications"
This field is set to a lookup wizard of the qualifications table
The lookup wizard is set to a checkbox list, which also allows multiple selection of values.
I have added a javascript onload event to show/hide a field called "qualifications_Other" if "Other" is selected from the "qualifications" lookup wizard checkbox list control.
Here is the javascript onload code:
//Start.............................................................................
var ctrlIvcX841 = Runner.getControl(pageid, 'qualifications');
var ctrlIvcX841T = Runner.getControl(pageid, 'qualifications_Other');
pageObj.hideField("qualifications_Other");
ctrlIvcX841.on('change', function(e) {
if (this.getValue()!= "Other"){
pageObj.showField("qualifications_Other");
ctrlIvcX841T.addValidation("IsRequired");
}
else {
pageObj.hideField("qualifications_Other");
ctrlIvcX841T.removeValidation("IsRequired");
ctrlIvcX841T.setValue('');
}
});
//End.............................................................................
This event works well if the exact value ONLY is selected by the user,
However because the user can select multiple values, if a user selects more than one value from the "qualifications" lookup wizard checkbox list control, the show/hide process is broken.
I was just wondering if possible can I change the operator or something to show or hide the field even if MULTIPLE values ("Other" being the trigger value) are selected in the"qualifications" lookup wizard checkbox list control?
I had a workaround for the problem below phpRv9 which was...
To new a field in the DB called qualifications_OtherCheck and position it directly under the check box list on add/edit pages If checked, show qualifications_Other, else hide.
This solution worked great in V9 however in V10 I'm struggling to position the new field directly under the existing "qualifications_Other" to make it look like the same control to the user.
Therefore I'm wondering if anyone has a way to check to see if a multi-select lookup contains a certain value.
Many thanks
J