• Hello,

    I have posted in the specific plugin forum, but got no replies. Hoping someone can help!

    I am trying to figure out how to assign classes to content rendered from within a shortcode. I need to style parts of checkboxes as bold but Contact Form 7 short code for Checkbox doesn’t register my class assignments as html, but rather as text. So, for instance, I have a shortcode that says [checkbox “item1” “item2” “item3”], and I would like the numbers in each item to be bold. How can I go about this?

    Basically, is there anyway to force the plugin to read some of the content within a shortcode as html rather then text?

    Any help is greatly appreciated! Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    It may be difficult doing so through CF7 hooks. I would try using jQuery to apply the styles after the page loads. There should be some way of accessing the appropriate elements using the right combination of selectors.

    Thread Starter lilts520

    (@lilts520)

    thanks, i ended up doing just that in js.
    Using an id on the checkbox (CF7 markup id:paychoice) and then adding a script like the following and running it “onLoad” inside the body tag:

    function updatecheckboxlabels() {
    var paypalText = “<b>PAYPAL</b>
    Once membership is accepted, you will receive a link to complete your payment.”;
    var checkText = “<b>CHECK</b>
    details on check”;

    var targetDiv = document.getElementById(“paychoice”).getElementsByClassName(“wpcf7-list-item-label”);
    //for the first checkbox:
    targetDiv[0].innerHTML = paypalText;
    //for the second checkbox:
    targetDiv[1].innerHTML = checkText;

    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Contact Form 7 Checkboxes/radio buttons’ is closed to new replies.