Skip to main content
kavyam0002
May 17, 2022
Question

checkbox and radiobutton

  • May 17, 2022
  • 10 replies
  • 0 views

Hi,

in the interface we used checkbox to select multiple, now bcz of some reasons user wants to select one item at a time so am thinking to go with radiobutton 

is that right way or do we have any other options? 

and even i have checked with radio button but am getting this error, hope nothing difference b/w check box and radio button

can anyone suggest me

    10 replies

    gopalk2865
    Participating Frequently
    May 17, 2022

    Hi Kavya, choosing between checkbox and radio button depends on your UI preference and what kind of options you want to provide to end users. and for the error , looks like the value of the radio button is not available in the choice values array. make sure value parameter of the radioButton must available in choiceValues array. 

    kavyam0002
    May 17, 2022

    this is how i have made the changes.. just i have changed check box to radio button 

    gopalk2865
    Participating Frequently
    May 17, 2022

    why do you have choice labels as null?

    shubhamk0004
    May 17, 2022

    Hi Kavya,

    Make sure, your ChoiceValues and ChoiceLabels have same number of values. It can be same also.

    ChoiceLabels: This value is used to show to the end user.

    ChoiceValues: This value is used to save the value to the database table.

    Example of Gender: 

    ChoiceLabels: {"Male", "Female"}

    ChoiceValues: {1,2} or {"Male", "Female"}

    kavyam0002
    May 17, 2022

    will not show any values to end user from choiclabels.. whenever we select radio button then the value as 1 will be saved to db 

    shubhamk0004
    May 17, 2022

    Hi Kavya,

    Please see the below screenshot for your reference.

    choiceLabels: {"Male", "Female"},
    choiceValues: {1, 2},

    choiceLabels: {"Male", "Female"},
    choiceValues: {"Male", "Female"},