I have a multiple select and I made a function to check several parameters, each prints a different value in another form:
if ( (tot_v >= 10) || (perc_a < 100) ) {
$("#DA_IDO").val('1');
}
if ( (tot_v > 3) && (tot_v < 10) && (perc_a == 100) ) {
$("#DA_IDO").val('2');
}
if ( (tot_v <= 3) && (perc_a == 100) ) {
$("#DA_IDO").val('3');
}
Then we come to the incriminating if:
if ( !( array in {'One':'', 'Two':'','Three':'','Four':'','Five':''}) ) {
$("#DA_IDO").val('5');
}
This works, but in my mind if array = (One, Ten) the if shouldn't work as at least one of the items in the array is there, instead with an array like the if is triggered.
What am I doing wrong? Is so hard to search for "javascript in" in google .-)
Thanks