Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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
  • 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: 43016
76
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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
 
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic