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
9 replies
Subscribers
7 subscribers
Views
3993 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Radio Button: There are three Radio buttons('radio1','radio2
anilkumark
over 9 years ago
Radio Button:
There are three Radio buttons('radio1','radio2' and 'radio3') as required fields in a form. Based upon the selection of 'radio1' either 'radio2' or 'radio3' should be shown. This I have done by javascript. But as the radio buttons are required fields, the hidden radio button is not allowing to submit the form. Can any one help me how to set null value for the hidden radio button(which is required field). Thanks in advance.
OriginalPostID-148241
OriginalPostID-148241
Discussion posts and replies are publicly visible
0
sikhivahans
over 9 years ago
@anilkumark Hi, are you facing any problem in setting the 'required' attribute of radio button to false programatically (i.e. you could set the 'required' attribute of a component on the flight upon interacting with some other component)?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
anilkumark
over 9 years ago
This is the js I am using,
var radVal = FormAPI.getValue("radio1").id;
if(radVal=="AGGREGATED")
{
FormAPI.show("radio2");
FormAPI.hide("radio3");
FormAPI.setRequired("radio3",false);
}
else
{
FormAPI.show("radio3");
FormAPI.hide("radio2");
FormAPI.setRequired("radio2",false);
}
But form is not allowing to submit. Showing a validation message{required field cannot be empty} to radio button(which is hidden).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rajatm
over 9 years ago
I think you will have to make the other two radio buttons 'optional' and when needed validate those by JS only and not appian default.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
anilkumark
over 9 years ago
can you provide the js for the same.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Amitkumar
over 9 years ago
If you have input parameters for the radio buttons / hidden fields on the form, can you check those input parameters and uncheck the required option against an input parameter and then try? You can keep the field required on the form, also you can uncheck the required option on input parameters.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@anilkumark I hope your issue will be resolved if you do as follows:
I would like to suggest to control the 'required' attribute of radio2 and radio3 completely in java script on the load of form based on the value of radio1 i.e. write a script which will set the 'required' attribute of radio2 and radio3 depending on the value of radio1 and include the same on the load of form (I guess this is the script which you have already included in the above comments). And at the same time make the fields optional from the forms designer settings, as java script is already offering you the 'required' feature from your code.
Also apply the same code snippet while you interact with 'radio1'.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rodgraham
Certified Lead Developer
over 9 years ago
If you put the radio buttons in a section on the form and hide the section then I believe the required on the radio button is not checked
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
harshav
over 9 years ago
Is your requirement suites of controlling it after the form submit like validating based on the rules.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
anilkumark
over 9 years ago
@rodgraham. I tried both ways, by using section and without section. But the form is validating the radio button as it is required field.
There are three Radio buttons('radio1','radio2' and 'radio3') as required fields in a form. Based upon the selection of 'radio1' either 'radio2' or 'radio3' should be shown. This I have done by javascript. But as the radio buttons are required fields, the hidden radio button is not allowing to submit the form. How can we avoid this.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel