admin管理员组

文章数量:1294383

I have a showCustomersList() javascript function in FunctionBag.js now I want to call that function in onchange event of the springs <form:select onchange=""> tag in a jsp file.

How can I do that?

I have a showCustomersList() javascript function in FunctionBag.js now I want to call that function in onchange event of the springs <form:select onchange=""> tag in a jsp file.

How can I do that?

Share Improve this question edited Jul 27, 2011 at 15:58 cfeduke 23.2k10 gold badges63 silver badges65 bronze badges asked Jul 27, 2011 at 15:48 aman.nepidaman.nepid 3,0549 gold badges43 silver badges48 bronze badges 1
  • Are you using jQuery? I suppose jQuery .change() will do it just fine – Boris Treukhov Commented Jul 27, 2011 at 15:55
Add a ment  | 

2 Answers 2

Reset to default 4

This is how we do it in 2011. use Jquery

$('#yourFormId select').change(function() {
    showCustomersList();
});

This should work

<form:select onchange="javascript:showCustomersList();">

本文标签: How to call javascript function in onchange event with spring form tagStack Overflow