tick the boxes

Discussion in 'HTML' started by WindAndWaves, Nov 23, 2004.

  1. WindAndWaves

    WindAndWaves Guest

    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
     
    WindAndWaves, Nov 23, 2004
    #1
    1. Advertising

  2. WindAndWaves

    Mark Parnell Guest

    Previously in alt.html, WindAndWaves <> 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
     
    Mark Parnell, Nov 23, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce W.1

    Kill the tick sound on refresh?

    Bruce W.1, Feb 2, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    809
    charles
    Feb 3, 2004
  2. Martin Eyles

    tick marks

    Martin Eyles, Sep 6, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    853
    Alvin Bruney - ASP.NET MVP
    Sep 13, 2005
  3. John
    Replies:
    5
    Views:
    1,807
    OHM \( One Handed Man \)
    Apr 15, 2006
  4. graphicsxp

    update gridview on checkbox tick/untick

    graphicsxp, Jul 12, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,076
    S. Justin Gengo
    Jul 12, 2006
  5. kloppie
    Replies:
    0
    Views:
    652
    kloppie
    Mar 13, 2007
Loading...

Share This Page