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 November 5th, 2004, 06:42 AM
id123 id123 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 118 id123 User rank is Private First Class (20 - 50 Reputation Level)id123 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 2 h 53 m 40 sec
Reputation Power: 5
Checkbox validation problem

I have 3 checkboxes: fldPDF, fldArtwork, fldDoc. I want to display an alert box if none of them are checked. I have the following code
Code:
 function Validate(theform) {
if (document.theform.fldPDF.checked == false && document.theform.fldArtwork.checked == false && document.theform.fldDoc.checked == false) {
 alert("Please select at least one checkbox.\n");
 return false;
	 }
}  


This isnt working

i have this code on the form button:
<input name="imageField" value="submit" type="image" src="../images/addtoBasket.gif" onClick="return Validate(form<% =iRecordsShown %>)" width="107" height="18" border="0>
does anyone have any ideas on how to make this work

Reply With Quote
  #2  
Old November 12th, 2004, 10:06 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
What's happening? Are you even getting into function? Place an alert at the top of the function to see if you are even getting into it. You may try changing this:

onClick="return Validate(form<% =iRecordsShown %>)"

to:

onClick="return Validate(this)"

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Checkbox validation problem


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 2 hosted by Hostway
Stay green...Green IT