app.alert with oCK struggle
I am incredibly green with JS, maybe a week into learning; please ELIM5. I have created a form that will highlight a field based on its value. The issue I am having is during validation. I am attempting to populate a window to remind the end user to check for restrictions. I have read the tutorial and created a code based on the information provided; however, I am still unable to get it to run correctly. I have provided both versions for reference. The first code populates an alert anytime the cell is changed, and I understand why based on the coding. The following code is my attempt at only having the warning populate based on fill color. Both versions are forcing the alert incorrectly or not at all. I previously had the app.alert in the format code (provided as struck in the first "if" case) but was unable to get the oCK to operate, which is a must for the end user. Thank you in advance for any assistance!
Format code:
var mf = (event.value);
if (mf =="1.1" || mf =="1.1A" || mf =="1.1B" || mf =="1.1C" || mf =="1.1D" || mf =="1.1E" || mf =="1.1F" || mf =="1.1G" || mf =="1.1H" || mf =="1.1J" || mf =="1.1K" || mf =="1.1L" || mf =="1.1N" || mf =="1.1S")
{event.target.fillColor = color.red;
app.alert("super important message!", 1, 0, "Title", oCK );
event.rc = false;
}else{
if (mf == second case)
{event.target.fillColor = color.red;
}else{
if (mf == third case)
{event.target.fillColor = ["RGB",1,.35,0];
}else{
if (mf == fourth case)
{event.target.fillColor = color.yellow;
}else{
//if less restrictive or blank
if (mf >= 2 || mf == "")
event.target.fillColor = ["T"];}
}}}
Validation code:
First attempt:
event.rc = !mf;
if(!event.rc && !this.hideWarning1){
var oCK = {bAfterValue:false};
app.alert({cMsg:"super important message!", nIcon:1, nType:0, cTitle:"amazing title", oCheckbox:oCK});
hideWarning1 = oCK.bAfterValue;
}
Second attempt:
event.rc = event.target.fillColor;
if(!event.rc !== ["T"] && !this.hideWarning1){
var oCK = {bAfterValue:false};
app.alert({cMsg:"super important message!", nIcon:1, nType:0, cTitle:"amazing title", oCheckbox:oCK});
hideWarning1 = oCK.bAfterValue;
}
