Through jQuery I would like to find a way to disable an input ONLY IF EMPTY on_ click of a button below.
This is the input:
<input type="text" min="0" id="toolset-maps-distance-center" name="toolset_maps_distance_center" class="form-control js-toolset-maps-distance-center js-wpv-filter-trigger" value="" required="" placeholder="Inserisci una posizione" autocomplete="off">
This is the button:
<button type="submit" class="wpv-submit-trigger js-wpv-submit-trigger btn">Recherche</button>
This is my jQuery:
jQuery('.wpv-submit-trigger.js-wpv-submit-trigger.btn').click(function(){
jQuery('#toolset-maps-distance-center').prop('disabled', true);
});
The result in the console is:
Uncaught SyntaxError: Invalid or unexpected token
attr('diabled', 'disabled')instead ofprop