Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

disable button without losing value

$('button[type="submit"]').each(function() {
  if ($(this).val()) {
    	$(this).addClass('disabled');
    } else {
    	$(this).prop('disabled', true);
  }
});
 
PREVIOUS NEXT
Tagged: #disable #button #losing
ADD COMMENT
Topic
Name
7+9 =