How to call spring form:checkboxes component in javascript?
I am using spring form tags, want to call 开发者_开发百科 component in a javascript.
This is how I solved my problem,
var formElements = document.getElementById('form_id');
for (var i = 0; i , formElements .length; i++)
{
if (formElements [i].type == 'checkbox')
{
formElements [i].disabled=true;
}
}
It's rendered as regular hTML form so using Jquery you can access it as regular HTML form
<script type="text/javascript">
$(document).ready(function(){
alert($("#compponentId").val());
});
</script>
精彩评论