What's the maximum number of operators you that can be used in an if statement?
Posted
by DMinGod
on Stack Overflow
See other posts from Stack Overflow
or by DMinGod
Published on 2009-12-29T12:29:18Z
Indexed on
2010/05/09
5:08 UTC
Read the original article
Hit count: 264
Hi, i'm using jquery and I'm trying to validate a form. My question is - What is the maximum number of tests can you give in a single if statement.
function cc_validate () {
if ($("#name").val() == "" || $("#ship_name").val() == "" || $("#address").val() == "" || $("#city").val() == "" || $("#ship_city").val() == "" || $("#state").val() == "" || $("#ship_state").val() == "" || $("#postal_code").val() == "" || isNaN($("#postal_code").val()) || $("#phone").val() == "" || $("#ship_phone").val() == "" || isNaN($("#phone").val()) || isNaN($("#ship_phone").val()) || $("#mobile_number").val() == "" || $("#ship_mobile_number").val() == "" || isNaN($("#mobile_number").val()) || isNaN($("#ship_mobile_number").val()) || $("#email").val() == "") {
return false;
} else {
return true;
} }
© Stack Overflow or respective owner