Answers for "jquery check if value is empty of number input"

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

input number has empty value

The hack is to use type="tel" instead of type="number".

This solves the 2 main issues:

It pulls up a number keypad on mobile devices
It validates (and is not empty) with numbers or non-numbers as input.
Posted by: Guest on June-29-2020

Code answers related to "jquery check if value is empty of number input"

Code answers related to "Javascript"

Browse Popular Code Answers by Language