• Resolved 3Lancer

    (@3lancer)


    Hi,

    I’m attempting to create a custom signup email checkbox with your plugin:

    <form class="woocommerce-EditAccountForm edit-account" action="" method="post">
    			        <?php wp_nonce_field( 'save_account_details' ); ?>
    			        <input type="hidden" class="woocommerce-Input woocommerce-Input--email input-text" name="account_email" id="account_email" value="<?php echo esc_attr( $user->user_email ); ?>" />
    			        <p><label>Receive News Emails: <input type="checkbox" name="mc4wp-subscribe" value="1" onchange="this.form.submit()" /></label></p>
    			        <input type="hidden" name="action" value="save_account_details" />
    </form>

    It’s working, except doesn’t show the box ticked if subscribed. Is there a way I can toggle this value=”1″ on the checkbox?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Lap

    (@lapzor)

    I guess you could expand the Javascript a little to first check if the checkbox is checked, and only submit if it’s so.

    https://www.w3schools.com/howto/howto_js_display_checkbox_text.asp

    Or did you want the checkbox to be checked if the user signed up earlier?
    For that you may want to look into our UserSync add-on, although I don’t think it’s worth the hassle / it’s not easy to set this up and might not always work.

    Hope that helps. If you have any questions, please let us know!

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Checkbox’ is closed to new replies.