Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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...
 
Sheriff
Posts: 67402
173
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.
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic