Reputation: 11
I have tried to find the answer to this question, but everything that I have tried did not work. (including putting 'false' 'not' etc in the code)
Right now this checkbox is checked by default, but I want to make the default to the unchecked box. (So it's not unchecking a checked box with jquery, I would like it to be unchecked in the first place.)
The code goes as follows:
<?php if (FEC_SHIPPING_ADDRESS == 'true') { ?>
if (!jQuery('#shippingAddress-checkbox').is(':checked')) {
<?php if (ACCOUNT_GENDER == 'true') echo ' check_radio("gender_shipping", "' . addslashes(ENTRY_GENDER_ERROR) . '");' . "\n"; ?>
Upvotes: 1
Views: 10457
Reputation: 69
Removing the "checked" attribute completely from the checkbox input element will cause the checkbox to become unchecked. Adding the valueless "checked" attribute to the input element will cause it to become checked.
http://www.w3schools.com/tags/att_input_checked.asp
Upvotes: 0