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
15 replies
Subscribers
7 subscribers
Views
4421 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I have a form with many user input fields and 5 submit buttons. Each button has
rohitw
Certified Lead Developer
over 9 years ago
I have a form with many user input fields and 5 submit buttons. Each button has its own validation group for its own set of fields. Now there is one user input field which should not be mandatory for one of the buttons but should be mandatory for all other buttons. How can this requirement be implemented?
OriginalPostID-176796
OriginalPostID-176796
Discussion posts and replies are publicly visible
0
pauln
over 9 years ago
Within the field in question use the code..
required: if(<button_saveInto()> = "<button_value>", false, true)
assuming the <button> is the button that you don't want the value to be required for
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
pauln
over 9 years ago
Meh, that would set the default to true, disregard
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
pauln
over 9 years ago
You could do..
required: if(<button_saveInto()> = "<button_value>", false,
if(<button_saveInto()> = "<otherButton#_value>", true, {})
Repeated for as many buttons as you need
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rohitw
Certified Lead Developer
over 9 years ago
Thanks Paulin for the response. The issue with this approach is that the SaveInto of any submit button doesn't execute unless all it's required fields are filled up. So if the button in question has another mandatory field and if it is blank, it will still show the common field (the field in question) as required.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
pauln
over 9 years ago
I don't understand your requirements. Can you attach the code you have now?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rohitw
Certified Lead Developer
over 9 years ago
Sure. Please find attached the sample form.
SampleForm.txt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
madhanka
A Score Level 1
over 9 years ago
Hi Rohit. I think if you have validationGroup as {"VG1","VG2","VG3","VG4"} for the common field, it should work.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rohitw
Certified Lead Developer
over 9 years ago
Hi Madhan, validationGroup doesn't take list, if you specify list, only last element is used.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
pauln
over 9 years ago
What is your use case? I can't find a direct solution to this problem but I am sure there are other ways to get done what you need
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
madhanka
A Score Level 1
over 9 years ago
My bad. I have done similar use cases by enabling or disabling the buttons. In your use case, you can enable the button VG1 when all the VG1 fields including the common field has a value. for button VG5 you can use all VG5 button excluding the common field. But not sure if this solution would fit your requirements.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>