HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 4th, 2005, 03:41 PM
sam_sam sam_sam is offline
Contributing User
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2005
Posts: 1,377 sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 12 h 16 m 54 sec
Reputation Power: 10
small error urgent help

Hi,

i have a 2 radio buttons named as Conf and a drop down named as ConfOD

so if the user selects first radio button and then he selects the ConfOD
i want to display an alert saying he cant do that

so i have written this code which works fine if the user selects the radio button and something in drop down

but then what i did was selected the radio button and changed the drop down Select a day... option but it still shows the alert can someone tell me whats wrong with it
my radio buttons and drop downs are like these

Code:
 Radio buttons like these
 <input type="radio" id="AD" name="Conf" value="All/any day" /> 
 <input type="radio" id="OD" name="Conf" value="One day only" /> 
 
 drop down is like this
 
 <select id="ConfOD" name="ConfOD" size="1">
 <option value="0">Select a day...</option>
 <option value="Monday">Monday</option>
 <option value="Tuesday">Tuesday</option>
 
 


Code:
 if((document.frm1.Conf[0].checked) || (document.frm1.ConfOD.selectedIndex > 0))
 {
 
  alert( alertMsg += "- You have done the wrong selection");					    
 					return false;
 			   }
 
 
 



thanks,

sammy

Reply With Quote
  #2  
Old February 5th, 2005, 11:42 AM
sam_sam sam_sam is offline
Contributing User
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2005
Posts: 1,377 sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level)sam_sam User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 12 h 16 m 54 sec
Reputation Power: 10
Hi,

i think i got this one working simple simple mistake the || should be replaced with && so the following lines works


if((document.frm1.Conf[0].checked) && (document.frm1.ConfOD.selectedIndex > 0))


thanks,

sammy

Reply With Quote
  #3  
Old February 7th, 2005, 02:44 AM
dejaone dejaone is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 11 dejaone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 53 sec
Reputation Power: 0
that's what I was going to say

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > small error urgent help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT