Apologies I didn't know how best to work the title, hopefully I can explain better below:
Essentially I have some code below:
def dropDown = getFieldById("customfield_10052")
log.debug("dropdown value" + dropDown.getValue())
if (dropDown.getValue() == "Art") {
dropDown.setError("cannot choose art here")
} else {
}
I am essentially checking a custom field for if its value is Art and choosing to display an error message if it is.
My problem is, if the user ever simply selects Art even with the intention of later selecting something else, the error message shows and wont go away, even if the user selects a different value.
Is there something I could do within the else to remove the error message/ re initialize the form?
Many thanks for the help.
Hello,
Change the if part to this
if (dropDown.getValue() == "Art") {
dropDown.setError("cannot choose art here")
} else {
DropDown.setError("")
}
Hi Alexey,
Thank you so much, that worked.I should say I also discovered the method:
.clearError("")
You absolutely pointed me in the direction for that, many thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.