I want to call this function when user clicks this button.
<p><a class="btn btn-primary" onclick="addNewDriver();">Aņadir un nuevo conductor</a></p>
And my function is this one
function addNewDriver() { var pEntityType = <%=c.WIDOC_ENTITY_DRIVER%>; var pListEntities = <%=lListDrivers%>; location.href= "<%= c.url %>do/user/groupItemForm.step1.jsp?idClient=" + <%=pIdClient%> + "&listEntities:" + pListEntities + "&idGroup=" + <%=pIdGroup%> + "&entityType=" + pEntityType + "&<%= lBackButtonUrl %>"; }
Why google is giving me this error? Uncaught ReferenceError: addNewDriver is not defined