Show all radio button choices on display form.
Hello there,
When the user creates a new entry or edit form, they pick a radio button. However, when they view using the display form, only the choice that they selected appears (which is logical and expected). I want to make it so that ALL of the possible choices appear. Is there any possible way of doing this?
(I think I saw a post in the forum about it, but I can't find it now. I would appreciate if you refer me to it)
When the user creates a new entry or edit form, they pick a radio button. However, when they view using the display form, only the choice that they selected appears (which is logical and expected). I want to make it so that ALL of the possible choices appear. Is there any possible way of doing this?
(I think I saw a post in the forum about it, but I can't find it now. I would appreciate if you refer me to it)
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Katy,
Here you go, you only need to change the Internal Field name from Radio to your field name, and replace options in the array with your options:
Here you go, you only need to change the Internal Field name from Radio to your field name, and replace options in the array with your options:
Code: Select all
var value = fd.field('Radio').value();
var options = ['Enter Choice #1','Enter Choice #2','Enter Choice #3']
var control = '<span dir="none"><table cellpadding="0" cellspacing="1"><tbody>'
options.forEach(function(option){
if(option == value){
control += '<tr><td><span class="ms-RadioText" title="' + option + '"><input type="radio" checked="checked" disabled="disabled"><label>' + option + '</label></span></td></tr>'
}
else{
control += '<tr><td><span class="ms-RadioText" title="' + option + '"><input type="radio" disabled="disabled"><label>' + option + '</label></span></td></tr>'
}
});
control += '</tbody></table></span></div>'
fd.field('Radio')._control._el().html(control);
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests