Looking for a way to call Server side method (Java) upon dropdown selection-change and based on the server output (TRUE OR FALSE), enable or disable few checkboxes. Would highly appreciate if anyone can provide recommendations around the same.
Looking for a way to call Server side method (Java) upon dropdown selection-change and
Share
I’ve coded a quick example to show you how this would be done. First you will need to set up your java app to allow ajax calls. The java app will need to take in as input a single post variable name
selectedwhich is the value of the selected option in the dropdown menu. The java app will then need to return a json string formatted similar too:The 1, 3, and 5 represent the ids of the checkboxes you would like to be disabled. These can be any ids of any of the checkboxes. If it isn’t in this array, it will be set to enabled by default.
HTML:
Javascript/jquery
Also, here is the jsfiddle of it: http://jsfiddle.net/bpstw/1/
Hope that helps.