You can specify in which event you want to unlock your fields. On the following examples, php handlers do a 3 seconds sleep to give you the time to see the difference between each events.
Event | Description | Test 1 | Test 2 |
---|---|---|---|
data-unlock |
Without event, data-unlock has the same behaviour as data-unlock-complete. |
||
data-unlock-before |
Will unlock selected fields before the ajax call. May be useful for a "cancel" button for example. |
||
data-unlock-complete |
Will unlock selected fields after the ajax call, whatever if it failed or succeeded. Useful to repost data. |
||
data-unlock-success |
Will unlock selected fields after the ajax call, only if it succeeded. |
||
data-unlock-failure |
Will unlock selected fields after the ajax call, only if it failed. |
||
data-unlock-empty |
Will unlock selected fields after the ajax call, only if the response is empty. |
||
data-unlock-not-empty |
Will unlock selected fields after the ajax call, only if the response is not empty. |