Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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.
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!