• 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

How to pass runtime variables to Javascript function on onclick event form struts html:button tag ?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

My Problem is I am not able to call my Javascript function on onclick event of button from struts html:button tag. I am iterating some values from bean and passing those values to Javascript function "MyFunction". How to do that ? I am using struts tag <html:button > instead of pure HTML tag <input type = button>

Below code not working for struts tag for button


If I use pure HTML tag for button then it is working fine->


Please help me on this.
Thanks.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post the HTML that works for you, and the HTML that is generated by Struts.
 
Ranch Hand
Posts: 93
Python Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

JSTL expressions may work with struts tags,

try using like,
 
pratibha patel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Karthi,

Thanks for your reply, but my problem has no yet resolved. Find below explanation.

I have tried above code, it calls javascript function"myFunction" but takes value as it is. When I try to get values, for example->

it gives value "${no_list}". Here I want the actual value of no_list.

 
Karthik Jayachandran
Ranch Hand
Posts: 93
Python Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Oops, it is




Also these pages might help,

http://www.devrecipes.com/2009/10/19/jstl-and-struts-logic-tags-iteration-quick-reference/
http://java.itags.org/java-web-tier-apis/67929/
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pratibha,

Did you got any soluition for the below mentioned problem?
I am also facing similar issue and looking for some help.

Thanks Saurabh
 
Grow your own food... or 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