Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > tick the boxes

Reply
Thread Tools

tick the boxes

 
 
WindAndWaves
Guest
Posts: n/a
 
      11-23-2004
Hi Gurus

I am sorry to ask so many questions, but unfortunately, you are just such an
awesome source of knowledge that I can not help myself but ask lots. One
day, I hope to be able to answer other people's questions.

Here we go, I have the following function (I made it myself ...!)

function tic(form,a,z){
for(f=a;z;f++){
if(form[f].type=="checkbox"){
form[f].checked=true;
}
}
}

It is supposed to tick a range of tickboxes (e.g. 1-10 or 11-30), I want to
use a and z to identify the range.

I use the following to call the function:

<LABEL FOR="0">
<INPUT TYPE="checkbox" VALUE="0" NAME="0" CLASS="ix"
ONCLICK="tic(this.form,0,1);">
New Zealand Wide</LABEL>

However, even with a range from 0 to 1, it will tick all the boxes in the
form. Secondly, does anyone know how to make the reverse function? Can I
add a fourth variable that indicates whether the current tickbox is true or
false and then use this in the function?

I hope it all makes sense

Thank you once more for all your help

- Nicolaas




 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      11-23-2004
Previously in alt.html, WindAndWaves <(E-Mail Removed)> said:

> Hi Gurus


Gurus is on holidays, and isn't due back until after Christmas. Sorry.


The following is JavaScript, and as such is best addressed in a
JavaScript newsgroup, such as news://comp.lang.javascript

That's not to say that no one in alt.html can answer it, but in general
it is best to ask in a group specifically aimed at JavaScript.
Cross-posted and followups set.

> Here we go, I have the following function (I made it myself ...!)
>
> function tic(form,a,z){
> for(f=a;z;f++){
> if(form[f].type=="checkbox"){
> form[f].checked=true;
> }
> }
> }
>
> It is supposed to tick a range of tickboxes (e.g. 1-10 or 11-30), I want to
> use a and z to identify the range.
>
> I use the following to call the function:
>
> <LABEL FOR="0">
> <INPUT TYPE="checkbox" VALUE="0" NAME="0" CLASS="ix"
> ONCLICK="tic(this.form,0,1);">
> New Zealand Wide</LABEL>
>
> However, even with a range from 0 to 1, it will tick all the boxes in the
> form. Secondly, does anyone know how to make the reverse function? Can I
> add a fourth variable that indicates whether the current tickbox is true or
> false and then use this in the function?
>
> I hope it all makes sense
>
> Thank you once more for all your help
>
> - Nicolaas


--
Mark Parnell
http://www.clarkecomputers.com.au
"Never drink rum&coke whilst reading usenet" - rf 2004
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Space between input boxes and selection boxes is not the same in Internet Explorer Stefan Mueller HTML 5 06-16-2009 02:06 PM
Shortcut for selecting tick boxes. geothermal Computer Support 4 03-11-2009 05:56 PM
IE - Selecting Tick Boxes In One Go? Dave Computer Support 2 05-17-2007 07:30 PM
Column of tick boxes - how to do it? John ASP .Net 5 04-15-2006 03:46 PM
OT: What makes Tron2003 tick =?iso-8859-1?Q?Frisbee=AE_MCNGP?= MCSE 21 07-23-2003 05:20 PM



Advertisments