DirtyFormWarning
Warns the user before leaving the page if there are changes to a Form. Form submits do not trigger this warning.
See also: Live Demo
Parameters
| Name | Type | Direction | Required | Default | Description |
|---|---|---|---|---|---|
| form | IBinding | in | yes | The Form component to track changes in. | |
| message | String | in | no | empty string | Warning message to display when form is dirty. |
| forceWarning | boolean | in | no | false | If true, always display warning. |
Body: discarded
Informal parameters: not allowed
Reserved parameters:
Examples
This example displays a warning after editing a form field and attempting to leave the page.
HTML template
<form jwcid="form@Form">
<input type="text" jwcid="@TextField" value="ognl:text"/>
<input type="submit" value="OK"/>
</form>
<!-- note: you should put the script right after the form ends -->
<script jwcid="@tacos:DirtyFormWarning"
form="ognl:components.form"
message="You have unsaved changes."/>

