There are two button in my form, one is submit another is cancel. I have many validations in my form, but I notice that, the validations are applied to both buttons. I've also tried the validation group, but the behavior is after I click the button the validation will take effect.What I expect is that the verification will be performed after the user has entered the content, and it will only take effect on the submit button. Is this possible in Appian? If the validation group is the only way I can achieve, Is it possible to disable the submit button after the validation triggered?
Discussion posts and replies are publicly visible
edwardc8281 said:the validations are applied to both buttons
you might have validate set to true for Cancel button also. You should turn it to false.
edwardc8281 said:Is this possible in Appian?
Yes it is! To achieve this set a validation group in the submit button widget e.g. “submitValidate” . Next add the same validation group in all the fields you want to validate after submit button click. Like if you have a textfield it should have validation group set with same value “submitValidate”.
edwardc8281 said:If the validation group is the only way I can achieve, Is it possible to disable the submit button after the validation triggered?
No its not! And if you are validating your form on this button click it should be enabled as well so that users clicks on it and validations are performed.
The Cancel button issue occurs when its validate property is set to true - switch this to false to prevent validations from firing. To ensure validations only execute when Submit is clicked, assign a validationGroup property to your Submit button, then apply this identical group name to every field requiring validation. This approach means validations remain dormant until Submit is pressed. Regarding disabling the Submit button after validation triggers - this isn't feasible with validationGroup since the button must remain clickable to actually fire those validations in the first place.
Thanks
Shubham Aware said:This approach means validations remain dormant until Submit is pressed.
Be cautious, though, because adding a Validation Group to a field (still(!!!)) hides its "required" indicator, and there is still(!) no manual workaround for this that I know of. Due to this I usually avoid validation groups altogether except in very small, niche, unusual cases where it's a better approach than other options (like conditionally disabling buttons, etc).