Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="checkbox" class="whatever" name="whatever" value="1">
- <input type="hidden" class="myHidden" name="hiddenField" value="">
- <script>
- // whether checked or unchecked, this will run
- $('.whatever').check(function() {
- var value = $(this).val();
- $('.myHidden').val(value);
- });
- if ( $('.myHidden').val() == '1' )
- $('.whatever').checked();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement