I
I
Ilya Alekseev2016-01-08 23:11:57
JavaScript
Ilya Alekseev, 2016-01-08 23:11:57

How to check all input values ​​without required?

Here I have a bunch of all sorts of different inputs and I need to make sure that the button is no longer disabled. The main thing I need is a condition for inputs

if ($("input[name='1']").val() !="" &&
$("input[name='2']").val() !="" &&
$("input[name='3']").val() !="" )
{
$("#but").removeClass("disabled");
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Litvinenko, 2016-01-08
@edli007

$("input[name='1'], input[name='2'], input[name='3']").map(...)

Further, I think, you will understand.
By the way, it's better to do not just .val() but .val().trim() so that spaces are not counted as letters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question