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

Pass value of radio button to struts2 action class using javascript

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

struts code :


<s:iterator value="#cList" status="stat">
<s:if test="#stat.first==true">
<td align="center"><input type="radio" name="rType" checked value='<s:property />'/> </td>
</s:if>
<td><s:property /></td>
</s:iterator>

-- i need to pass radio value to these action,so please help me out of this...

function ProcessSubmit(){

document.getElementById('actionframe').src="./GetRecordList.action";
/*
document.frmProcess.action="./GetRecordList.action";*/
document.frmProcess.submit();
}



Thanks in Advance,
Karthik G.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi karthik,
You need to just add one variable to your action class whose name should be as same as radio button's name and also its getter and setter.
Thats it.You will get a value of radio button.
Thank you..
 
karthik swamy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Shripad Katkamwar wrote:Hi karthik,
You need to just add one variable to your action class whose name should be as same as radio button's name and also its getter and setter.
Thats it.You will get a value of radio button.
Thank you..



Thank You,Shripad it works.
 
A timing clock, fuse wire, high explosives and a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic