User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 426,493 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,261 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 697 | Replies: 2 | Solved
Reply
Join Date: Oct 2007
Location: Penang Island, Malaysia
Posts: 173
Reputation: lordx78 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
lordx78's Avatar
lordx78 lordx78 is offline Offline
Junior Poster

if statement not working

  #1  
Apr 18th, 2008
  1. var cBrand = document.getElementById('cBrand');
  2. var cType = document.getElementById('cType');
  3. var cStyle = document.getElementById('cStyle');
  4. var cFrame = document.getElementById('cFrame');
  5. var cGroupSet = document.getElementById('cGroupSet');
  6.  
  7. if (empty(cBrand) && empty(cType) && empty(cStyle) && empty(cFrame) && empty(cGroupSet))
  8. {
  9. alert("Please Choose atleast 2 Criteria");
  10. return false;
  11. }else{
  12. return true;
  13. }

The above code is not working --------- Please advise. thx
"I might not be the BEST but I'm not like the REST!"
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,858
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 344
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: if statement not working

  #2  
Apr 18th, 2008
Where is the definition of the empty() function? It would be better if you posted a working copy of your code which we can directly use for testing your example rather than trying to figure out what seems to be wrong in the small snippet presented to us.
Last edited by ~s.o.s~ : Apr 18th, 2008 at 2:14 pm.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Join Date: Oct 2007
Location: Penang Island, Malaysia
Posts: 173
Reputation: lordx78 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
lordx78's Avatar
lordx78 lordx78 is offline Offline
Junior Poster

Re: if statement not working

  #3  
Apr 20th, 2008
Thanks for the advise, solved.
"I might not be the BEST but I'm not like the REST!"
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 5:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC