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
4 subscribers
Views
2187 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Am using FormAPI.setRequired("checkboxfieldid").id; in on load event o
sudharanid
A Score Level 3
over 12 years ago
Am using FormAPI.setRequired("checkboxfieldid").id; in on load event of form to make checkbox field as required dynamically. The checkbox allows multiple values. Am storing the selected values of checkbox in to DB.The statement is setting the field as required but it is not displaying the values that are selected. If am removing the required statement it is displaying the selected values. It is also working when checkbox is of single type and only 1 value is selected. Please help me how to make multivalued checkbox as required dynamically.........
OriginalPostID-65101
OriginalPostID-65101
Discussion posts and replies are publicly visible
0
raghunandanj3904
Certified Senior Developer
over 12 years ago
FormAPI.setRequired("checkboxfieldid", true);
Pls check this.. And also, make sure u create multiple valued ac! and pv! to hold the selected values.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudharanid
A Score Level 3
over 12 years ago
ac! is of type multiple and we are storing as a string value in CDt and while retrieving we are splitting it and displaying the values.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 12 years ago
Hi Sudha, It just works perfect. Follow this:
Add importScript("/plugins/servlet/FormsExt.js"); in you on load, followed by FormAPI.setRequired("checkboxfieldid", true);
Then save the value to ac! and in data output tab map it to a string or CDT as you like. I just reproduced the scenario and it worked perfect for me.! I am generating the check box values thru constants!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudharanid
A Score Level 3
over 12 years ago
Hi raghunandan i have tried the approach which you have specified,its working fine.Its able to display values of checkbox but based on radiobutton value am making checkbox field as visible and required,So for the first time if at all the checkbox is visible then its displaying selected values but when i perform onclick event of radiobutton i.e say i have selected "No" and again i have selected "Yes" then the selected checkbox values are not getting displayed.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 12 years ago
Hi Sudha, even for that, the same approach works. i tried now.
On click of radio button,
var radVal = FormAPI.getValue("radifieldId").id;
if(radVal=="Yes")
{
FormAPI.show("multichkboxID");
FormAPI.setRequired("multichkboxID",true);
}
else
{
FormAPI.hide("multichkboxID");
FormAPI.setRequired("multichkboxID",false);}
And in frm onload, initially keep the chekbox hidden.
This approach works fine for me.
Hope it helps
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel