• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difficulties to understand radio buttons logic

 
Mahmood Ali
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am having some difficulties while trying to understand the radio buttons logic.

I have two radio buttons and their name is FR.

From the database, I am retrieving a value which is "F" or "R" which stands for (Freeze & Release).

I would like to do that If the value = F then the radio button which is Freeze to be checked else the other radio button to be chekced.

I tried to use

if FV_Value.equals("F") then I stopped where I do not know exactly how to deal with them.

Can you please help?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Johnny Jim", please check your private messages for an important administrative matter. Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You simply need to place the checked attribute on the radio button that you wish to be selected.
 
Mahmood Ali
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, Sorry you did not understand my question.

If I am retrieving the radio button value from the database.

If it is "F" then I would like the freeze to be checked else the other radio button to be checked
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understood perfectly. Simply place the checked attribute on the radio button that you want checked.

One of <c:if>, <c:choose>, or the EL's ternary operator will come in handy to make the decision.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!