Page 1 of 1
Hide None option for Radio Button
Posted: 2023-02-23 20:28
by mgoetze
Currently, I have a radio button field with the Options: Yes;;No. The field is NOT required. When I go to publish my app, the radio button options are:
None
Yes
No
Is there any way to hide the NONE option when a radio button field is NOT required?
Re: Hide None option for Radio Button
Posted: 2023-02-23 22:28
by jsetzer
I think I did not get the business case:
The field is NOT required
If the answer is optional...
hide the NONE option
... and, at the same time, the answer has to be either
yes
or
no
,
... then what shall the user select if he/she doesn't want to answer the optional question?
In other words:
If required, they have to select a given option.
If not required, you have to provide an option for 'nothing selected'.
AppGini does this for us.
If you manage to remove the 'None' option by using Javascript, the select control would fallback to the first option "yes", I guess. That would be identical with just setting the field to 'Required'.
Maybe if you could give some more information on the business case we could find a different solution.
Re: Hide None option for Radio Button
Posted: 2023-02-23 22:46
by peebee
A no-code solution, presuming you still want to keep the field(s) as optional; you could just change the language string of "None" (in the language.php file or via the Admin tool) to something more suitable such as "Not Applicable", "Optional", "Undecided" or "Pending", whatever might suit your purpose a little better.
It will of course change "None" globally but as far as I'm aware, I think the radio buttons are the only place that "None" applies?
Re: Hide None option for Radio Button
Posted: 2023-05-19 18:43
by xbox2007
please try this code
i use to hide None on my check_Type field
Code: Select all
$j('#Check_Type0').hide().next().hide();