I am using Grails, and a beginner. could somebody guide me through the following problem:
I want to pass the values in a select option along with an id to the controller from the view. I have tried using remoteFunction, createlink to pass the params through javascript but failed. Where am i going wrong?
define select in gsp
<g:select name="id" from="${1..5}" noSelection="['-1':'所有']" class="form-control" value="${selectedIds}"/>
define change function in block
<g:javascript>
$("#id").change(function(){
var id = $("#id").val();
$.post("${request.contextPath}/formUrl",{id:id},function(data){
});
});
</g:javascript>