Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
7 subscribers
Views
4675 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I have a Sail form with a confirmation message set on the submit button and mult
smcgill
over 9 years ago
I have a Sail form with a confirmation message set on the submit button and multiple required fields, including some set within an applyComponents function. My issue is that if a required field is not completed but the user clicks on the submit button the confirmation message is displayed before the fields are shown in error.
I have added an indicator for one of the fields and added this as a condition to the confirmation message and this works for that one field. Is there any way to check if any required fields are missing without having to put indicators on every required field? What would be the best way to do this?
OriginalPostID-149851
OriginalPostID-149851
Discussion posts and replies are publicly visible
Top Replies
Siva
over 9 years ago
+1
Certified Lead Developer
Hi McGill, One option is you can disable the button if any one of the required field is empty. Enable the button only when all the required fields are not empty.
0
Poorna Guduri
A Score Level 1
over 9 years ago
Hi smcgill, a combination of a!buttonWidget() with a "validate" parameter must work. The parameter validate says the button that validate all the required fields on the form and do not submit the form unless they all are filled. Please find the attached snippet code for reference. Hope it helps.
Sample Code.txt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
smcgill
over 9 years ago
Hi Poornah,
Thanks for the example.
Please correct me if I'm wrong but this still requires a indicator to be set for each required field.
Is there a function to check at a form level if there are any outstanding errors?
The alternative that I wanted to avoid was to set an error indicator in a with() and update it if any required fields are null and then check that in the confirmMessage.
BTW I'm currently using a!buttonWidgetSubmit with the skipValidation set to false which I believe is th default
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Siva
Certified Lead Developer
over 9 years ago
Hi McGill,
One option is you can disable the button if any one of the required field is empty. Enable the button only when all the required fields are not empty.
Cancel
Vote Up
+1
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@smcgill Hi, Documentation at https://forum.appian.com/suite/help/7.9/SAIL_Components.html#SubmitButton or https://forum.appian.com/suite/help/7.9/SAIL_Components.html#Button under 'Notes' say that "The SAIL interface only refreshes and the saveInto state change only occurs if the user clicks Yes".
As far as my understanding is considered, the approaches discussed above also lead you to make usage of the indicators which you are already doing.
AFAIK there isn't a possibility of detecting the outstanding errors by making use of OOTB functionality. I guess there is no other alternative apart from the one you have chosen. The only thing which we could give a thought about at the moment is, how best (generic in terms of development, less dependency on the other components and effective in terms of execution) we can implement the alternative approach.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
smcgill
over 9 years ago
Thanks for the info.
I was hoping that there was a behind the scenes array that I could check but I guess it's back to indicators then!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel