Javascript....driving me crazy....doesn't make sense

Ok...so I have this: function checkFields() { var isEmpty = true; var fname = trim(document.getElementById("fname").value); var lname = trim(document.getElementById("lname").value); var ruid = trim(document.getElementById("ruid").value); if(fname != "" && lname != "" && ruid != "") { isEmpty = false; radioStatus(isEmpty); } } and if I fill out all 3 text fields, it makes "isEmpty" false like it should (and when I first load the page, it fails and the "isEmpty" stays true like stated .... but if I fill out all 3, and then erase one or two...then the fname = "" and lname = "" and ruid = ""....but it will fail this test and not make "isEmpty" true like it should..... even in debugging mode I am seeing that the variables are "" but its failing.. shouldn't this be that if any of these variables are NOT "" (thus have values in them) then it will fail since I used AND... right???? arg!!! help please ..

以上就是Javascript....driving me crazy....doesn't make sense的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏