FormDialog takes general HTML FORMs and changes them into Dialogs. Values inputted by users in Forms is converted into JavaScript objects (Dictionary or Hash).
You can create instances through the code shown below:
The first argument (xed) is an instance of xq.Editor. The second argument is an HTML string that will be shown on the screen. You can just use the following format "<form ...> ... </form>". Or for nonvisible domains or in other words, DIV that is set as style="display: none;", put that into the FORM. You can obtain the corresponding innerHTML and leave it as an argument. The third argument, when you are ready to have the FORM appear on the screen, this becomes the called callback function which can be shortened by leaving it as null. The function onCloseHandler occurs when the user submits or cancels the FORM. If the FORM is submitted, the callback function's argument will be carried over as a JavaScripot object.
For example, when FORM is the same as the following:
if the user inputs "hello" in field1 and "world" in field2 and then submits, the callback function's first argument will be as follows:
thus, using the code shown below, you can obtain form values:
If you have generated FormDialog, using the following code will allow you to display a dialog on the screen:
Take note that, if you want to give automatic Focus to a certain field you must set class="initialFocus" at the corresponding field:
From the xq.Editor.handleLink function, refer to the embodied code for basic link dialog by using the FormDialog API.
Back