EDIT: Fixed small bug in the HTML file, which was fixed by handling the "KMDidShowWindow()" event. Zip file now contains version 1.2.
- NOTE: The actual window is wider than this, but I had to cut down the image so it would display correctly on the forum. By default, Bootstrap won't let you get the window this narrow. But see my reply that explains how to get around this, if you want a narrower form.
Bootstrap Html Prompt Example v1.2.zip (406.5 KB)
This macro and associated HTML files provide an example of how to make a Custom HTML Prompt using the Bootstrap framework. See http://getbootstrap.com/ for more information.
Like the standard Custom HTML Example macro, this example shows how to setup the various control types, like text boxes, dropdown lists, etc. It also shows how to use variables to initialize the various fields, and retrieve the results when done.
The items for the various dropdown lists are also supplied through variables, not hard-coded in the HTML file.
“typeahead.js” is used to show how to make an auto-completion control. See https://twitter.github.io/typeahead.js/ for more information. You supply the auto-complete items via a KM variable. You can also supply a variable with a list of suggested items that pop up when the user enters the control, but hasn’t typed anything yet.
Unzipping the files
Unzip the files, and place the HTML files and folders together in a folder, like the image above shows.
Import the macro library. It is thoroughly commented, and works out-of-the-box, with the following exception:
In the macro, you need to enable the above Action, and put the location of the HTML file in it. If you forget to do this before you run the macro, it will tell you.
Comments are provided in the HTML file, in an attempt to make it easier for you to mold it into whatever you need. I’m no HTML expert by any means, but I think this is a fairly clean example.
I hope this is useful. Please let me know if anything doesn’t work correctly, or if you have questions or suggestions.