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
Post a Comment