Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > JavaScript and CSS

JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-03-2008, 08:14 AM
gszauer's Avatar   
gszauer gszauer is offline
Programmer
 
Join Date: Nov 2007
Location: Florida
Age: 18
Posts: 113
Rep Power: 3
gszauer is on a distinguished road
Default need a validation script

I have a bunch of checkboxes, each with a unique name.
I need a script that makes it so at least one checkbox is required....
Anyone have such a script?
__________________
Quote:
Originally Posted by ~Aristotle
It is the mark of an educated mind to entertain a tought without accepting it
If my post was helpful, please help me build some rep
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-03-2008, 10:52 AM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,135
Rep Power: 16
Lop is on a distinguished road
Default

You could just cycle through the boxes and make sure they are checked:

HTML Code:
var isChecked = false;

for (i = 0; i < lists.length; i++)
{
     if (lists[i].checked == true)
     {
            isChecked = true;
      }
}

if (isChecked == false)
{
       alert("You must check at least one option!");
}
This is untested but you get the idea. This also assumes your checkboxes are named "lists".
__________________
Lop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-08-2008, 02:10 PM
gszauer's Avatar   
gszauer gszauer is offline
Programmer
 
Join Date: Nov 2007
Location: Florida
Age: 18
Posts: 113
Rep Power: 3
gszauer is on a distinguished road
Default

I see, thank you for the help
__________________
Quote:
Originally Posted by ~Aristotle
It is the mark of an educated mind to entertain a tought without accepting it
If my post was helpful, please help me build some rep
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a script vulnerable to SQL injection? shibbythestoner PHP Forum 7 12-15-2007 08:56 PM
Hacking Perl Script falco85 Perl 5 11-12-2007 04:51 PM
JavaScript:Tutorial, Using an External Script TcM Javascript 7 09-11-2007 07:39 AM
(Script) Copy content to clipboard, how? annannienann Visual Basic Programming 0 06-19-2007 05:20 PM


All times are GMT -5. The time now is 01:56 PM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
LogicKills ........ 20.00000
sam ........ 20.00000
gaylo565 ........ 18.00000
|pH| ........ 15.00000
WingedPanther ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 67%

Ads