Enable form fields when ajax calls are given back.
data-unlock will remove disabled attribute on form fields. This option is automatically set when using data-lock, so fields are locked before the ajax call and unlocked after, avoiding multiple posts. Sometimes, it is required to control manually lock and unlock states according to the call's success or the response's content, so you are able to use this option independantly.
This form looks like this:
<label for="number">Enter a number between 1 and 100...</label> <input type="text" id="number" name="number" value="50"/> <br/> <input type="button" value="Send" class="btn domajax click" data-endpoint="unlock-more-less-handler.php" data-input="#number" data-lock-before=".everything" data-unlock-failure="#thats-less" data-unlock-empty="#thats-more" data-unlock-not-empty="#thats-it" /> <br/><br/> <input type="button" id="thats-less" class="btn everything" value="That's Less!" disabled/> <input type="button" id="thats-it" class="btn everything" value="That's it!" disabled/> <input type="button" id="thats-more" class="btn everything" value="That's More!" disabled/>
All the documentation at a glance