• Hello, Is there any plugin or something so that I can make 3 check box in page and button value will change according to check box. For example I have 3 check box:

    O Check box 1
    O Check box 2
    O Check box 3

    Here is the one [button]

    if user tick check box 1 then button have a link https://domain.com
    if user tick check box 2 then button have a link https://domain2.com
    if user tick check box 3 then button have a link https://domain3.com

Viewing 1 replies (of 1 total)
  • Hi @davecoledave,

    I whipped up an example on CodePen that does this.

    You should be able to tweak the JavaScript to add the HTML button ID that you’ll use in your code.

    I.e., Change #go to your button’s ID value.

    To use the JavaScript (with your tweak):

    1. Copy and paste into the footer area of your site using the Insert Headers and Footer plugin or

    2. Write a PHP action hook in your child theme’s functions.php file to inject the JavaScript into the footer of your pages.

    Example code snippet for the functions.php (method #2 from above).

    
    <?php
    /* Inline script printed out in the footer */
    function my_add_script_wp_footer() {
        ?>
            <script>
                COPYJAVASCRIPTCODEHERE
            </script>
        <?php
    }
    add_action('wp_footer', 'my_add_script_wp_footer');
    
    • This reply was modified 3 years, 9 months ago by mark l chaves. Reason: Formatting
Viewing 1 replies (of 1 total)
  • The topic ‘Check box and button value’ is closed to new replies.