Answers for "when click on submit button form form empty jquery"

1

jquery check if input is empty on submit

var empty = true;
$('input[type="text"]').each(function() {
   if ($(this).val() != "") {
      empty = false;
      return false;
   }
});
Posted by: Guest on March-10-2021
0

jquery don't empty specific form field after submit

// Bind an event handler to the "click" JavaScript event
$('#clear').click(function(){
    // Selects all elements of type text and clear all
    $('#parent > input:text:not(".ignore")').val('');   
  	// For excluding Multiple inputs 
  	$("input:text:not('#objective_time_period, #subjective_time_period')").val('');
});

Example : http://jsfiddle.net/3zVyv/1/
Posted by: Guest on November-13-2020

Code answers related to "when click on submit button form form empty jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language