Hi,
I am currently looking for an option to remove the 'none' value from radio buttons, without setting the field as required. Alternatively I am looking for a solution to make two checkboxes behave like radio buttons (two options: 'yes' OR 'no').
The second question I have is, whether it is possible to limit the number of selections in a multi select list? I have a multi select list with 10 options, but a user should only be allowed to select 2 options out of 10.
Thank you!
Ok, I found a way to transform two checkboxes into radio buttons, just in case somebody is interested:
If there is a customfield with two checkboxes on the create screen, the internal id of these checkboxes was customfield_xxxxx-1 and customfield_xxxxx-2. I then injected some JavaScript with the help of the PowerScripts Add on:
AJS.$("#customfield_xxxxx-1").change(function() {
$("#customfield_xxxxx-2").prop('checked', false);
});
AJS.$("#customfield_xxxxx-2").change(function() {
$("#customfield_xxxxx-1").prop('checked', false);
});
Seems strange, but works for me...
That's copying stuff with javascript - pretty much the wrong way to do anything.
I'm not going to knock it if it works for you. But for anyone looking for the "right" answer, this is not really it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excuse me, I do not get your point here. It does exactly what I want it to do. I asked for a way to transform two checkboxes, it solved the problem. So far, no alternative solutions available.
What is "the right answer" in your opinion?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Because you've converted them into the wrong form, and your javascript will only work in some places (and is likely to break on upgrade)
You should really go back to doing it properly. Use the right sort of field with default and a mandatory flag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would like to do it as you suggest, but as I said before, I can not use the mandatory flag on fields I need to hide, depending on a selection a user makes. So there is no way around it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you don't offer "none", then how does a user set the value to "nothing"? With no "none", you might as well default it and make it mandatory.
You can't natively restrict the number of selections, you need a little bit of code in validators or possibly something on-screen to do it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem with making it mandatory is, that I can not hide the field with JJupin. That is why I am looking for an alternative. I want the users to select either 'yes' or 'no'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then make sure it has options yes or no and make it mandatory.
What's the point of hiding it if you want to make them enter it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Because I have different fields appearing on the create screen, depending on a selection a user makes at the beginning. I know, it is a bit complicated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mandatory drop-down = no 'none' option.
Non-mandatory drop-down = none option.
As far as the second part goes, try customizing the field description in the field configuration scheme to explain to the users that they should only select two options. Hopefully they all read and follow. ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.