• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts with javascript

 
piyush kumar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i have one jsp which is called viewserver.jsp and viewaction class, now what i am doing is ion my jsp there are some radio buttons and corresponding values of the radio button. now when i click on the radio button iot calls a javascript function serverid(this.form, this.value) in which i am passing the form and the corresponding value which is clicked . now i want that this value should be transffered to my Action class which uis viewaction for furthur processing. c an anybody tell me how to transfer the single value to the action class.
thanks in advance
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just submit the form? Then the action class can just read the value from the request.

If you want to communicate with the Action without submitting the form, you will have to use an AJAX call.
 
John Simpson
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To further elaborate on Merrill's point,

Make sure that you have an id for the element, and also make sure that the ActionForm of your jsp has corresponding setters/getters for the parameter of that id.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic