You can specify in which event you want to put your fields readonly. On the following examples, php handlers do a 3 seconds sleep to give you the time to see the difference between each events. Also, the lock selector is empty, meaning that only the button you click will be affected.

Event Description Test 1 Test 2
data-lock

Without event, data-lock is a combination of data-lock-before and data-unlock-complete.

 
data-lock-before

Will lock selected fields before the ajax call.

 
data-lock-complete

Will lock selected fields after the ajax call, whatever if it failed or succeeded.

data-lock-success

Will lock selected fields after the ajax call, only if it succeeded.

data-lock-failure

Will lock selected fields after the ajax call, only if it failed.

data-lock-empty

Will lock selected fields after the ajax call, only if the response is empty.

data-lock-not-empty

Will lock selected fields after the ajax call, only if the response is not empty.

Back to domajax's home