Copy link to clipboard
Copied
Hi there!
Prior to trigger an action with a button I want to warn user he/she must select an item in a ComboBox named "CBSCH".
Item at index 0 of the ComboBox has no data attached and label is "Please, select a school".
Example;
searchBtn.onRelease = function() {
var school = CBSCH.selectedIndex;
if (school = 0) {
errorMsgFld.html = true;
errorMsgFld.htmlText = "<font color='#FF0000'>Please, select a school.</font>";
}
else {
searchFct();
}
};
This doesn't work. What's wrong.
I also used selectedItem.data = ""
Wrong too.
I thank you in advance for your help!
use the double equal (==) to test for equality:
searchBtn.onRelease = function() {
var school = CBSCH.selectedIndex;
if (school == 0) {
errorMsgFld.html = true;
errorMsgFld.htmlText = "<font color='#FF0000'>Please, select a school.</font>";
}
else {
searchFct();
}
};
Copy link to clipboard
Copied
use the double equal (==) to test for equality:
searchBtn.onRelease = function() {
var school = CBSCH.selectedIndex;
if (school == 0) {
errorMsgFld.html = true;
errorMsgFld.htmlText = "<font color='#FF0000'>Please, select a school.</font>";
}
else {
searchFct();
}
};
Copy link to clipboard
Copied
PERFECT!
It works nice and smooth...
Thank you very much, kglad.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now