E
E
Evgeny Petrov2018-03-04 16:24:31
JavaScript
Evgeny Petrov, 2018-03-04 16:24:31

Is there an OR in javascript?

There are 11 text boxes on the site page.
You must fill one of them to submit the form using ajax.
I registered a check for filling one of the fields like this, but it did not work:

if( $("#pole1").val()!='' or $("#pole2").val()!='' or $("#pole3").val()!=''){
send form
}else{
error
}

How to be in such a situation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2018-03-04
@borgore

OR is not present, but as well as in the majority of programming languages ​​there is ||

$("#pole1").val() !== '' || $("#pole2").val() !== ''

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question