Process the ajax request only if selector's inputs have been updated.
Sometimes, we need to process an ajax call as soon as users are typing, such as on a search form, or when a field is auto-completed / auto-saved. But, there are some keys that do not change field's contents, such as arrows or ctrl / alt keys. This option let you avoid sending an ajax call twice if a value has not been updated.
This form looks like this:
<label>Type something:</label> <input type="text" class="domajax keyup" data-endpoint="value-typing-handler.php" data-input="" data-output="#output" /> <br/><br/> <div id="output"></div>
This form looks like this:
<div id="inputs"> <label>Enter a fruit</label> <input type="text" id="fruit" value="orange"/> <br/> <input type="button" value="Submit" class="btn domajax click" data-endpoint="value-other-handler.php" data-input="#inputs" data-output="#output" data-value="#fruit" /> </div> <div id="output"></div>
This form looks like this:
<div id="inputs"> <label>Enter a fruit</label> <input type="text" id="fruit"/> <br/> <label>Enter a vegetable</label> <input type="text" id="vegetable"/> <br/> <input type="button" value="Submit" class="btn domajax click" data-endpoint="value-form-handler.php" data-input="#inputs" data-output="#output" data-value="#inputs" /> </div> <div id="output"></div>
All the documentation at a glance