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.
Resources:
- Stack Overflow: How to detect escape key press with javascript [duplicate]
- jQuery: ID Selector (“#id”)
- jQuery: .keyUp()
- MDN: event.keyCode
Hi Tom,
Great post, thank you. Can you please let me know to access the toolbar JavaScript? I’m still fairly new to Flare.
Regards,
Steve
Thanks for reading!
There is a help topic online and in the application.
http://webhelp.madcapsoftware.com/flare11/Content/Skins/More_About_Skins/Specifying_Web_Toolbar_Settings_for_HTML5_Output.htm
Other resources are listed on MadCap’s website.
http://www.madcapsoftware.com/resources/
There is also a JavaScript chapter in the companion book to this blog.
http://xmlpress.net/publications/flare/