File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Iterate html:radio

 
Saathvik Reddy
Ranch Hand
Posts: 228
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us your code.
 
Soumya Saha
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic