ورود

View Full Version : سوال: مشکل این کد اعتبار سنجی چیه که if دومی رو اجرا نمیکنه؟



saeed-71
شنبه 20 اردیبهشت 1393, 15:09 عصر
سلام.مشکل این کد اعتبار سنجی چیه که if دومی رو اجرا نمیکنه؟



$(document).ready(function(){
$("#insert").submit(function() {


if($("#gheymat").val().replace(/\s/g, "") == ""){
$("#result").html("قیمت خودرو نباید خالی باشد").show(300);
$("#result").css({"color":"red","background-color":"#ffe4e0"});
return false;
}

if($("#name").val().replace(/\s/g, "") == ""){
$("#result").html("برند انتخاب نشده است.").show(300);
$("#result").css({"color":"red","background-color":"#ffe4e0"});
return false;
}
return true;

});
});