Clear a Flare HTML5 Search Field with the Escape Key

If you want the search field in Flare HTML5 output to clear when escape is pressed, add the following to the toolbar JavaScript.

window.onload = function() {
    $("#search-field").keyup(function (e) {
        if (e.keyCode == 27) { $("#search-field").val(""); }

If there is already a window.onload assignment, just add the inner part to the existing assignment.




  1. Hi Tom,
    Great post, thank you. Can you please let me know to access the toolbar JavaScript? I’m still fairly new to Flare.


    1. Thanks for reading!

      There is a help topic online and in the application.

      Other resources are listed on MadCap’s website.

      There is also a JavaScript chapter in the companion book to this blog.

Leave a comment

Your email address will not be published.

HTML tags are not allowed.

251,115 Spambots Blocked by Simple Comments