The spring checkbox tag does not have attribute called ‘checked’ because checked or unchecked in spring is supposed to be set based on the value of the element in the underlying model. This is good…but how can we do this:
There are 2 spring checkboxes . On checking one, i want to write a javascript that checks the other.
Without a checked property, how can i use javascript to accomplish the task?
The spring checkbox tag does not have attribute called ‘checked’ because checked or unchecked
Share
The JSP tags are executed at server-side, and generate HTML. JavaSCript is executed at client-side, in the browser, and manipulates the HTML DOM.
The HTML checkboxes generated by the Spring tags are no different than all other checkboxes, and of course have a
checkedattribute. And you may change it using JavaScript. At client-side, you don’t care whether the HTML is static, has been generated by Spring, PHP or whatever. HTML is HTML.