Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Dynamic radio button problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I generate dynamic single radio button in <s:iterator> . how will i know which radio button was clicked....code is given below



Now i want to know which radio button was clicked.....because this one only gives me one value...
 
Ranch Hand
Posts: 213
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not clear by your code what you are trying to accomplish.

The way you would do a radio button from a list is like this.:

In my action form I have:



In my jsp I have:



The returned value is contained in searchSpecResult so searchSpecResult would return One, Two, or Three depending on what was selected. That is how you know what button is pressed

In your code it looks like you are trying to do a group of radio buttons in every loop in your iterator. If that is what you are trying to do then you will need to have the value in the name attribute be a unique field name for each group of buttons.
So if addpayer is a collection for the returned value, you should set the radio button like this:
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

parsinglord jain wrote:Hi,

I generate dynamic single radio button in <s:iterator> . how will i know which radio button was clicked....code is given below



Now i want to know which radio button was clicked.....because this one only gives me one value...



Hi ,
I have similary type issue . I want to generate two radio button ( YES /NO) inside one iterator.
And depending upon some condition i have to check one .. COuld you please help me in this
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic