I want to hide a custom field if there is nothing in another custom field that is a Text Field (multi-line).
I am trying to use the behaviour plugin, but can't figure out how to check if a text field is empty.
How would I validate against the Text Field to see if it is empty?
You script would look like this
def multiLineField = getFieldById(getFieldChanged())
def fieldToHide = getFieldByName("field to hide name")
if (multiLineField.getValue() && !multiLineField.getValue().toString().isEmpty()) {
fieldToHide.setHidden(true)
}
else {
fieldToHide.setHidden(false)
}
Thank you! This got me on the right track.
I changed this line:
(multiLineField.getValue() && !multiLineField.getValue().toString().isEmpty())
To
(multiLineField.getValue().toString().isEmpty())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.