Possible Duplicate:
pass parameter in g:remoteLink as result of javascript function
I am trying to call a remoteFunction call that is triggered by an onclick for a button, but the click does not call the function. I have tested the onlick command with an alert startment and the function is called. here is my code.
<input type="button" onclick="exportList()" value= "Export"/>
function exportList(){
var profile= document.getElementById('dropdown').value
${remoteFunction(controller: 'profile' , action:'export', params: "'profile=' + profile")}
}
When I take out the parameter and the var profile, the function is STILL not called… My controller and action are properly named so I do not know why I am having this error. Thanks in advance if you can help!
JoeCortopassi is correct – you can’t just use the grails construct of
${remoteFunction...}directly in javascript. I’ve done this using Jquery like this: