jquery javascript question

Posted by mckenzie on Stack Overflow See other posts from Stack Overflow or by mckenzie
Published on 2010-05-13T06:10:46Z Indexed on 2010/05/13 6:14 UTC
Read the original article Hit count: 278

Filed under:

Hello,

var val = $("#desc").val();   // input box
var val2 = $("#type").val();  // select box
if((val=='') || (val2 == ''))
     {
     alert("err");
     }
else { // codes }

when i select dropdown and not type anything on inputbox, the alert err still comes out?

how to make it when dropdown is selected, it goes to else clause?

© Stack Overflow or respective owner

Related posts about jQuery