• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

having problems with javascript

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello there

how do i assign values in struts-html property with the javascript var attribute. For example how do i assign the value in the below javascript var attribute,



my struts-html tag is " html:hidden property="paymentAmount" "

Now how do i assign the paymentAmount value with the grandTotal variable.
When i was using the input attribute in the normal html it was working fine.
Please help me regarding this matter.

thanks
jeyakanth
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using the below piece of code.
var grandTotal = some-value;
document.getElementsByName("paymentAmount")[0].value = grandTotal;

Alternatively, if you have the property associated with a form then you can write,
document.forms[0].paymentAmount.value = grandTotal;
 
jeyakanth yogaratnam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello

the solution you gave is not working. The value is not getting stored into the form bean. As i when i retrieve the value from the logger only the default value is getting posted. Any idea regarding this, any suggestion. Please help me.

regards
jeyakanth
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you ever figure out what was going on. I am having the same issue. Works with FF but fails with IE
 
Come have lunch with me Arthur. Adventure will follow. This tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic