Answers for "empty form jquery"

9

jquery reset form

$('.login-form').trigger("reset");
Posted by: Guest on May-13-2020
2

jquery clear form values

$(".reset").click(function() {
    $(this).closest('form').find("input[type=text], textarea").val("");
});
Posted by: Guest on April-03-2020
0

jquery empty all forms

$("#register").trigger("reset");
Posted by: Guest on May-02-2021
0

set form empty jquery

$('#formId')[0].reset();
OR 
// For jQuery 1.6+:
$(':input','#formId')
  .not(':button, :submit, :reset, :hidden')
  .val('')
  .prop('checked', false)
  .prop('selected', false);

// For jQuery < 1.6:
$(':input','#formId')
  .not(':button, :submit, :reset, :hidden')
  .val('')
  .removeAttr('checked')
  .removeAttr('selected');
Posted by: Guest on June-29-2021
0

empty form elements except jquery

// 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 "Javascript"

Browse Popular Code Answers by Language