• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to by dfault get the radio button be selected

 
vijaya Yarlagadda
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am using struts framework. And I want a radio button to be selected by default. This is my code...
In jsp:
<html:radio property="check" value="Promote" >Promote</html:radio>
<html:radio property="check" value="Shift" />Shift</td></tr>

In FormBean Class:
private String check = null;

public String getCheck() {
return check;
}

public void setCheck(String check) {
this.check = check;
}

I want promote to be selected by default. I also tried by assigning the value promote in the bean class.. but stil i couldnt get it.. I wil be very grateful if anyone can help me out...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"vijayaY vijayaY", please check your private messages for an important administrative matter.
 
Rodrigo Tomita
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set the value in the class you declared to be your form. This thread has a discussion about the same subject.

Hope it helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic