Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author ulihake

    (@ulih)

    Hello Brendavo.

    This is in fact not a bug, this is a specific implementation problem you have with a third party script that you like to combine with WCPGSK. If I’d start to give support for each and every implementation problem that people encounter I would not be able to do anything else… This is free software but this does not mean that I write code and scripts for your particular website.

    You can however adapt the script I sent to you for your other problem. A bit of JQuery documentation and you will be able to set the state of all your radio buttons to unchecked. I include a last line of code for your particular website, but please understand that I cannot help you with these problems if they are not related to real bugs in WCPGSK.

    jQuery('#billing_testselect_field').find('input[name="billing_testselect"]').each(function() {
     jQuery(this).prop('checked', false);
    });

    Regards.

    uh

    Plugin Author ulihake

    (@ulih)

    And sorry, this is the code you need…

    jQuery('#billing_testselect_field').find('input[name="billing_testselect"]').each(function() {
     jQuery(this).prop('checked', false);
    });

    the each part was missing…

    Hope this helps you to understand how to manipulate your fields for your specific needs in the future.

    uh

    Plugin Author ulihake

    (@ulih)

    upps… it was there… but not visible on screen directly…

    Anyhow. Good luck with your website

    Thread Starter Brendavo

    (@successful-life)

    Your code does not work. It is not unchecking the radio.

    People on Stackoverflow suggested this code:

    jQuery("#billing_piegadatajs_field").find("input[name=\"billing_piegadatajs\"]").each(function() {
        jQuery(this).prop("checked", false);

    did not work either.

    Someone else there edited your code that did not work to this, but still not working:

    jQuery('#billing_piegadatajs_field')
        .find('input[name="billing_piegadatajs"]')
        .prop('checked', false);

    Also. does not matter what i put in your Checkout Settings > Checkout Scrip box – it ALWAYS returns “errorerror”.

    Thread Starter Brendavo

    (@successful-life)

    Ok, for some reason putting this

    jQuery(document).ready(function(){
        jQuery('#billing_piegadatajs_field')
        jQuery('#billing_piegadatajs_field').find('input[name="billing_piegadatajs"]').each(function() {
     jQuery(this).prop('checked', false);
    });
    });

    directly in wcpgsk-user.js above the var for the drop-down list worked now, but it DOES NOT work when i put it in Checkout Settings > Checkout Scrip box.
    It display errorerror!

    And it doesnt work either if i wp_enqueue it from functions.php and putting the script in a js file.

    Very strange

    Plugin Author ulihake

    (@ulih)

    I’ve tested this and that’s not working. You’re right. The jQuery part only works in the wcpgsk-user.js. I will provide a fix for this with the next update. In the meantime you will have to use the wcpgsk-user.js and backup the contents when you update the plugin the next time.

    uh

    Its very awkward but i found a workaround this problem. Go old school,
    use document.ElementById() in place of $…its working

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to set radio buttons to be unchecked by default’ is closed to new replies.