Skip to main content
100%

Check / Uncheck Checkbox multiple times ! PROP

✓ Published0🌍 Public
IIliaIdakiev
Last edited Sep 5, 2013
Created on Sep 5, 2013

This example demonstrates a form control that reflects whether an ID appears in a preselected list, toggling a checkbox’s checked state each time the user interacts with it. The code parses a JSON-encoded array of duplicate IDs from the server-side model, then uses `jQuery.inArray` to test membership and sets the `prop('checked', true/false)` accordingly. The behavior is driven entirely by the `#isDuplicate` checkbox, whose state updates based on the presence of the selected ID in the provided data. No animation or complex rendering is involved; the visualization relies on jQuery’s attribute manipulation and the browser’s native checkbox handling.

AI-generated description

Similar vizzes