File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Iterate html:radio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Iterate html:radio" Watch "Iterate html:radio" New topic
Author

Iterate html:radio

Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Hi,

I have this code in JSP:

<logic resent name = "qvalues" >
<logic:iterate id = "qvalue" name = "qvalues" >
<html:radio property = "radio" idName="qvalue" value = "value" onklick="showLayer('layer1')"/>
<bean:write name = "qvalue" property = "value" />
</logic:iterate>
</logic resent>

I have a javascript which does

var i = document.getElementById("radio").value;

suppose if i have 3 radio buttons. if i klick on one of the radio btns it should get its value. but in this case its getting the same value for all the radio buttns. Please help me out with this

Thanks,
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
The qvalue is different for each iteration you might be giving different names for radio buttons check the generated HTML Code and make sure all the radio button names should be same.
Anshul Jain
Greenhorn

Joined: May 10, 2006
Posts: 12
Hi,

Did u get the answer from somewhere else? Please share with me also as I am also getting same problem. it is every time displaying value "5".

Please Help.

Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Show us your code.


Merrill
Consultant, Sima Solutions
Soumya Saha
Ranch Hand

Joined: Apr 14, 2006
Posts: 64
Hi,

Try this out:

<logic resent name = "qvalues" >
<logic:iterate id = "qvalue" name = "qvalues" >
<html:radio property = "radio" idName="qvalue" value = "qvalue" onklick="showLayer('layer1')"/>
<bean:write name = "qvalue" property = "value" />
</logic:iterate>
</logic resent>

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Iterate html:radio
 
Similar Threads
Logic iterate
Question about sturs form bean
One form, multiple radio button groups
problem with html:radio
Dynamically displaying html:option values