Is it possible, on change, to check the value of eventInfo.newValue and based on the check, cancel or undo the change? Or is there another method of some simple error/dependency checking for attributes? Here is my scenario: <select name="attr_charTypeA">
<option value="Star">Star</option>
<option value="CoStar">Co-Star</option>
<option value="Grunt">Grunt</option>
</select>
<select name="attr_charTypeB">
<option value="Civilian">Citizen</option>
<option value="Police">Police</option>
<option value="Military">Military</option>
<option value="NationalGuard">National Guard</option>
<option value="Survivor">Survivor</option>
<option value="Ganger">Ganger</option>
</select>
If charTypeB is Police,Military, or NationalGuard then I want to enforce that charTypeA can only be Grunt. I was able to accomplish this: <script type="text/worker">
on("change:chartypeb", function(eventInfo) {
if (eventInfo.newValue == "Police" || eventInfo.newValue == "Military" || eventInfo.newValue == "NationalGuard") {
setAttrs({
charTypeA: "Grunt";
});
}
});
</script>
But how do I prevent selecting Star or CoStar after charTypeB has been set to Police, Military or NationalGuard? This didn't seem to work: on("change:chartypea", function(eventInfo) {
if (eventInfo.newValue == "Star" || eventInfo.newValue == "CoStar") {
getAttrs(["chartypeb"], function(values) {
if (values.chartypeb == "Police" || values.chartypeb == "Military" || values.chartypeb == "NationalGuard") {
setAttrs({
charTypeA: "Grunt";
});
}
});
}
}); Thanks for taking a look!