Title: Check box and button value
Last modified: January 18, 2021

---

# Check box and button value

 *  [davecoledave](https://wordpress.org/support/users/davecoledave/)
 * (@davecoledave)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/check-box-and-button-value/)
 * 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](https://domain.com)
   
   if user tick check box 2 then button have a link [https://domain2.com](https://domain2.com)
   if user tick check box 3 then button have a link [https://domain3.com](https://domain3.com)

Viewing 1 replies (of 1 total)

 *  [mark l chaves](https://wordpress.org/support/users/mlchaves/)
 * (@mlchaves)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/check-box-and-button-value/#post-13946670)
 * Hi [@davecoledave](https://wordpress.org/support/users/davecoledave/),
 * I whipped up an example on [CodePen](https://codepen.io/marklchaves/pen/dypEezb?editors=1111)
   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 5 years, 4 months ago by [mark l chaves](https://wordpress.org/support/users/mlchaves/).
      Reason: Formatting

Viewing 1 replies (of 1 total)

The topic ‘Check box and button value’ is closed to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [links](https://wordpress.org/support/topic-tag/links/)
 * [radio buttons](https://wordpress.org/support/topic-tag/radio-buttons/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 1 reply
 * 2 participants
 * Last reply from: [mark l chaves](https://wordpress.org/support/users/mlchaves/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/check-box-and-button-value/#post-13946670)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
