• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No "CHECKED" feature for html:radio ?

 
Artemesia Lakener
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I searched the struts html tag API, but htmal:radio, there is no such a thing that matches to "CHECKED" in html's radio tag. How can we set it as default checked ?
 
Steve Li
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try

Thank you
Steve
 
Artemesia Lakener
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Steve Li:
Try

Thank you
Steve



You completely get me wrong. I am not asking for "check box", I was asking how to do the following html --

<type="radio" name="card" value="123" CHECKED/>
<type="radio" name="card" value="abc" />
<type="radio" name="card" value="xyz />

How to make that first line "CHECKED" syntax appear if I use html:radio tag ?
 
Rashmini Palakurti
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In html:radio there's no CHECKED attribute , that feature can be implemented by setting default value to the associated property in ActionForm.

For Example:

If u have something like this in ur JSP :

<html:radio property="gender" value="M">Male</html:radio> ---1
<html:radio property="gender" value="F">Female</html:radio>---2

then u can set 1 control as checked by initialising gender property to "M" in ur ActionForm or if u want to do it at run-time in Action class then u can do it by the setProperty of Gender.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic