Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Tri-state Checkboxes

  1. #1
    Join Date
    Nov 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tri-state Checkboxes

    Hey,

    Over the weekend I was writing a search page and realised that a user needed to be able to select a field to be true, false, and don't care. Now, as we all know, html checkboxes are on/off only. I couldn't find one I liked, so I created a very simple javascript class to create and handle tri-state checkboxes.

    It could still use some polishing (it uses images to render the checkbox, for example, and it could do with an image autoloader). The images it currently uses is firefox's checkbox, with some custom modifications. You can change these files to fit the style you need.

    The link is a zip containing the javascript file tristate.js, which contains the class TriStateBox, along with an example html file to show you how to instantiate your own boxes, and a folder containing the necessary images.

    Tristate Checkbox

    Hope it's helpful

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hi, Kazar.

    Thanks for the post. This should probably go in the DD script submission forum, though I'm not positive you want to submit it. Should I move it?
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Nov 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeah, thanks - I'm just new, not sure where everything goes

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, if it isn't finished, it really should stay out here in the general forum.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Nov 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, it works, it's just at version 1.0, not 2.0

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ok, it's been moved then.

    Tested as well. I like it. The style doesn't look like FF (at least not as I'm used to it), but I don't mind the look. having it differ could help the user understand as well.

    The problem I see with such a script is explaining it to the user, and what happens if javascript isn't enabled. A dropdown or radio set could do the same thing, using standard methods.

    Aside from that, though, nice.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Nov 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The problem with explaining is evident - it could maybe do with more obvious negative, postive images.

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Perhaps [ ], [?], and [√] would be best.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. #9
    Join Date
    Nov 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That is wise, although that would require the default state to be [?] - means perhaps that users would register it as different i guess

  10. #10
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Not necessarily. You could have it blank, then they click, get the [?] and figure it out from there.
    However, that's a making a few assumptions.

    It would be a very nice feature, but I'm not sure it really is practical, considering what users are used to.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •