• 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
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

need solution for ajax call using in struts 1.2

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I have 2 radio button in end jsp & I want the value of checked radio button but the problem is we are using the ajax call in home jsp that is going to struts action class & some manupulation is done in that action, action class forwards to end jsp in that jsp we have created 2 radio button. below is the code.

i am using struts 1.2 version

$.ajax({
type: "POST",
url: "abc.do",
data: { gender: gender , age: age , policyTerm: termSliderVal , sumassured: saSliderVal , smoker: lsmoker, saAmountFactor: radiocoverHidValue , abc: abc},
},
success : function(response, textStatus, jqXHR)
document.getElementById("xyz"+abc).innerHTML=response;
[/code]

the above ajax code calls to action class, that forwarded to the following end jsp
[code=javascript]
%>
<div>
<input type="radio" name ="upsell" id="sa" styleClass="upsellClass" value="original amount"> </div>

<div><input type="radio" name ="upsell" class="upsellClass" value="upsale amount">
<%[/code]

we added response to home jsp using inner html,these radio buttons can check dynamically, i need these radio button checked value in the home jsp.

need replay urgent thanks in advance,
 
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Why would want an Inner HTML instead you can change the div style visibility
2. Have tried what are all the forms and their element forms[0], forms[1]... if you have a single form you should be getting it else try other forms or I still would go with the first option

 
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
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!