• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Pass value of radio button to struts2 action class using javascript

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Poop goes in a willow feeder. Wipe with this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic