Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/407.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用“触发webflow事件”;onclick";grails中的remoteFunction_Javascript_Grails - Fatal编程技术网

Javascript 如何使用“触发webflow事件”;onclick";grails中的remoteFunction

Javascript 如何使用“触发webflow事件”;onclick";grails中的remoteFunction,javascript,grails,Javascript,Grails,例如,此复选框单击可触发webflow事件 <td><g:checkBox name="isSelected" value="${contestantInstance.id}" checked="false" onclick="${remoteFunction(action:'selectCheck',_eventID:Next id:contestantInstance.id, params:'\'isSelected=\' +

例如,此复选框单击可触发webflow事件

<td><g:checkBox name="isSelected" value="${contestantInstance.id}" checked="false"     onclick="${remoteFunction(action:'selectCheck',_eventID:Next id:contestantInstance.id,
                    params:'\'isSelected=\' + this.checked')}"  />

既然到目前为止还没有人回答,我可以试试

这个代码对我有用

标签中的Javascript代码

<script type="text/javascript">

        function enableText(checkBool, textId)
        {
            textFldObj = document.getElementById(textId);
            //Disable the text field
            textFldObj.disabled = !checkBool;
            //Clear value in the text field
            if (!checkBool) { textFldObj.value = ''; }
        }

    </script>

功能启用文本(checkBool,textId)
{
textFldObj=document.getElementById(textId);
//禁用文本字段
textFldObj.disabled=!checkBool;
//清除文本字段中的值
如果(!checkBool){textFldObj.value='';}
}
复选框和onclick事件都是

    <td><g:checkBox checked="false" name="allVideos" value="${videoInstance.id}" onclick="enableText(this.checked, '${videoInstance.id}');" /></td>

N.B.videoInstance是循环中变量的名称: