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
10 replies
Subscribers
10 subscribers
Views
5087 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Hello Everybody, Does anyone know how to make a text/paragraph field
Jin Pheh
Certified Associate Developer
over 9 years ago
Hello Everybody,
Does anyone know how to make a text/paragraph field only required when the user tries to submit via a specific button? Currently validations on form elements do not trigger when they are blank and I can't use the "required" option since I need to check the validation only when clicking a specific button. I have created a dummy snippet that demonstrates the problem:
load(
local!comment,
a!formLayout(
firstColumnContents: {
a!paragraphField(
value: local!comment,
saveInto: local!comment,
validations: if (len(local!comment) = 0, "You must enter a phrase.", ""),
validationGroup: "comment"
)
},
buttons: a!buttonLayout(
primaryButtons: a!buttonWidgetSubmit(label:"Validate", validationGroup: "comment"),
secondaryButtons: a!buttonWidgetSubmit(label:"Cancel")
)
)
)
OriginalPostID-139172
OriginalPostID-139172
Discussion posts and replies are publicly visible
Top Replies
venkats533
over 9 years ago
+1
try using validationGroup - on the specific button. define validation on the text box or paragraph filed. read forum recipes for sample code.
Parents
0
shamec
over 9 years ago
I'm not sure if this represents your actual use case but in this case you can use the "required" property on your comment and then set the "skipValidation" flag to true for you cancel button. If your usecase is something else other than cancel where you would need to validate on both buttons then this won't work...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
shamec
over 9 years ago
I'm not sure if this represents your actual use case but in this case you can use the "required" property on your comment and then set the "skipValidation" flag to true for you cancel button. If your usecase is something else other than cancel where you would need to validate on both buttons then this won't work...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data