Hide None option for Radio Button

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
mgoetze
Posts: 23
Joined: 2014-12-02 06:59

Hide None option for Radio Button

Post by mgoetze » 2023-02-23 20:28

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?

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Hide None option for Radio Button

Post by jsetzer » 2023-02-23 22:28

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.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Hide None option for Radio Button

Post by peebee » 2023-02-23 22:46

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?

xbox2007
Veteran Member
Posts: 129
Joined: 2016-12-16 16:49

Re: Hide None option for Radio Button

Post by xbox2007 » 2023-05-19 18:43

please try this code

i use to hide None on my check_Type field

Code: Select all

$j('#Check_Type0').hide().next().hide();

Post Reply