Details
-
Bug
-
Status: Done
-
High
-
Resolution: Fixed
-
4.3.19
-
None
-
0.8
Description
Steps to reproduce
- Attach a behaviour to a select list (SelectListA), that will make a text field (TextFieldA) required when value of SelectList equals to AAA
- For the serverside script use
def fieldA = getFieldByName("TextFieldA") def selectListA = getFieldById(getFieldChanged()) if (selectListA.getValue() == "AAA") { fieldA.setRequired(true) } else { fieldA.setRequired(false) }
- Select the AAA value and try to submit the issue, you will get an error You must enter a value for this field
- Select the BBB value, try to submit, the error message is still there despite the fact that the TextFieldA is not required any more, and you cannot submit the issue.
What is happening is that the asterisk is not there for the TextFieldA (correct) but if there is an error message from before, is not getting cleared and that prevents the submit.
Workaround
Clear the error from the script
def fieldA = getFieldByName("TextFieldA") def selectListA = getFieldById(getFieldChanged()) if (selectListA.getValue() == "AAA") { fieldA.setRequired(true) } else { fieldA.setRequired(false) fieldA.clearError() }