javascript - passing dynamic parameters in script.aculo.us -
i want pass dynamic values inside parameters of script.aculo.us auto suggestion in jsp page
below code want value of checkbox , pass server. in server side jsp printing ( i.e instead pf checkbox value printing document.getelementbyid("mgmtsystem").checked
)
<div class="auto_complete" id="object_name_auto_complete"></div> <script type="text/javascript"> new ajax.autocompleter('<%=name%>', 'object_name_auto_complete', '<%=request.getcontextpath()%>/component/ajax_introdata', { parameters: 'suggenable= document.getelementbyid("mgmtsystem").checked' }) </script>
in above code i'm trying send value of document.getelementbyid("mgmtsystem").checked
passing same instead value
if copied javascript question on code - why
this code not let document.getelementbyid(....)
evaluated , treats string
{ parameters: 'suggenable= document.getelementbyid("mgmtsystem").checked' }
try this
{ parameters: 'suggenable='+document.getelementbyid("mgmtsystem").checked }
or better yet use utility methods built in prototypejs
{ parameters: 'suggenable='+$("mgmtsystem").checked }
Comments
Post a Comment