javascript - Grails- how to call in gsp file to a function which is in js file through onchange event? -


i have gsp contains select element:

<select class="form-control companynameselect" id="companynameselect" name="companyselected"  onchange="companyteam()">     <g:each in="${companies }" var="company" >     <option value="${company?.id }">${company?.companyname}</option>     </g:each> </select> 

the companyteam function in file (js file) gsp "know". reason got following error: "uncaught referenceerror: companyteam not defined"

try bind js:

$(document).ready(function() {     $("#companynameselect").on('change', companyteam()); }); 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -