JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 15th, 2003, 10:34 AM
Henry Henry is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Australia
Posts: 25 Henry User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question checkboxes

Hello there,

I am developing a feedback form in DW MX, which is to have many checkboxes.

I want to create twelve check boxes underneath oneanother, which the user can tick/untick as he/she sees fit. However, I also want a main checkbox on top of the other checkboxes which can be ticked and when this main checkbox is ticked then all twelve checkboxes are automatically ticked. How is that developed?

I want the users to have the obtion of ticking off the main checkbox, which ticks all of them as well as allowing the users to tick as little or many as they like.

If you can provide an example with just three boxes, where one is the main checkbox and controls the other two - then I will be really pleased. Perhaps you can refer to a tutorial or provide the code?

Cheers,

WebMAD

Reply With Quote
  #2  
Old May 15th, 2003, 06:25 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
http://www.js-examples.com/example/?ex=602&mode=1

Note: this site has pretty much every conceivable JS solution... I've used it for years and it has never let me down.

I actually just implemented this myself on a client's site: http://www.timber.net.au/search.asp - feel free to have a look @ the source.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old May 16th, 2003, 05:57 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Once you know how it isnt too hard,

in a form, there is elements for each form item (checkbox, text, textarea, select, etc). To select all the checkbox elements in a particular form, you would use a function something like this:

PHP Code:
<script>

function 
CheckAll(chkStatus) {

//form_name is the value you suply when you set the name arg in the form tag

var frm document.form_name.elements

for(0frm.lengthi++) {

if(
frm.type == 'checkbox') {

if(
chkStatus) {

frm[i].checked true;

} else {

frm[i].checked false;

}

}

}

}

</script> 


this is the function you would use, then in the checkbox that selects all, you would place the following arg

onClick="CheckAll(this.checked);"

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > checkboxes


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway