This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Can I update attribute or class or search box?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Can I update attribute or class or search box?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30028
    yonahs61332yonahs61332
    Participant

    Can I update the class or attribute on the textbox in the search?

    I want to do this to allow hotjar to record the customer’s keystrokes.
    per their instrunctions:
    <!–data-hj-allow can be appended as either an attribute or a class –>
    <!– Allow and record any keystroke data typed in input fields –>
    <input name=”code” type=”text” data-hj-allow />
    <input class=”form-control data-hj-allow” name=”quantity” type=”text” />

    <!– Allow and record any keystroke data typed in textareas –>
    <textarea name=”comment” data-hj-allow></textarea>
    <textarea class=”form-control data-hj-allow” name=”comment”></textarea>

    Thanks

    #30031
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    It should be doable. To avoid editing any of the core filey, I recommend the custom code below. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter('asp_shortcode_output', 'change_asp_shortcode_output', 10, 2);
    function change_asp_shortcode_output($html, $id) {
    	return str_replace("class='orig'", "class='orig' data-hj-allow", $html);
    }
    #30032
    yonahs61332yonahs61332
    Participant

    Thanks, that worked.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Can I update attribute or class or search box?’ is closed to new replies.