4
I have a form with more or less 5 inputs, at any given time inputs will be worthless, and I want to find out what the lowest value between them, but whenever there is one or more inputs voids it returns the value 0 and indicates that this is the smallest number :(
With the inputs I am forming a string with
document.querySelectorAll("input").value;
Receiving the values of input
, but every time you have a input
empty one of the string locations takes zero and the
Math.min();
calculates this value as the smallest value in the string...
There is a way to ignore the empty input and not put it in the string? or something similar?
You could put the html of your inputs?
– Giovane
Actually the inputs only have the class I’m using in css, I didn’t put anything else
– Bruno Cabral
They are all
type=text
?– Giovane
in fact it is number, this receiving numbers, real values, this with the mask of jquery to catch the comma and the R$ automatically
– Bruno Cabral