• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

how to by dfault get the radio button be selected

 
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...
 
Marshal
Posts: 67279
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"vijayaY vijayaY", please check your private messages for an important administrative matter.
 
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.
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!