• Resolved Lockhart

    (@muldari)


    Is there any way to bold one or two words on a form label? HTML isn’t doing it.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @muldari !

    I trust you’re having a great day!

    As we can’t allow HTML code in the labels themselves (this would allow for a potential vulnerability), there are some workarounds:

    1. Remove the label from the field and place a HTML field above it to mimic the label instead.

    2. Use JavaScript (CSS can’t target specific words unfortunately):

    <?php
    
    add_action('wp_footer', function() {
    ?>
    <script type="text/javascript">
    jQuery(document).ready(function($) {
      setTimeout(function() {
        $('#forminator-module-1135 #radio-14 .forminator-label').html(function(i, text) {
          return text.replace("PATIENT AND/OR ACCOMPANYING ADULTS", "<strong>PATIENT AND/OR ACCOMPANYING ADULTS</strong>");
        });
      }, 500);
    });
    </script>
    <?php
    });

    This will replace “PATIENT AND/OR ACCOMPANYING ADULTS” with “PATIENT AND/OR ACCOMPANYING ADULTS“, making the text bold.

    To install the script – simply copy the code to a .php file and place the file in the wp-content/mu-plugins directory (create the directory if it doesn’t exist).

    The key part here is this:

    
    $('#forminator-module-1135 #radio-14 .forminator-label').html(function(i, text) {
          return text.replace("PATIENT AND/OR ACCOMPANYING ADULTS", "<strong>PATIENT AND/OR ACCOMPANYING ADULTS</strong>");
        });

    You can duplicate it for each text you’d like to replace. If you’re not familiar with JS, please let us know which specific parts you’d like to make bold and we’ll adjust the snippet for you.

    Warm regards,
    Pawel

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @muldari ,

    We haven’t heard from you for several days now, so it looks like you don’t have more questions for us.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bold Word on Form Label’ is closed to new replies.