Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Tri-state Checkboxes

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

    Default

    Yeah, well, the original destination use was for an admin panel advanced search, where I could basically give training session on how to use the system, so it's practical for that.

    I think mozilla has an option to create tri-state checkboxes, it's just that it's only for mozilla.

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

    Default

    Well, yes, of course, if you can explain it to people. No question there
    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. #13
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello,

    i like to test the tristate script. But the download didnt work. Can anybody give me another download link please?

    thanks

    Maik

  4. #14
    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

    Quote Originally Posted by Maik20 View Post
    Hello,

    i like to test the tristate script. But the download didnt work. Can anybody give me another download link please?

    thanks

    Maik
    I guess this should have stayed out in the general area, since the author is not maintaining the link. However, the script is currently here:

    http://developingme.co.uk/extra/tristate/tristate.js

    A demo of its use is currently here:

    http://www.developingme.co.uk/cms/Tri-State

    The author's site is currently:

    http://developingme.co.uk/cms/
    - John
    ________________________

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

  5. #15
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks a lot.

    But how can i get the result after submitting a form with this kind of checkbox?

    With a normal checkbox i use this:

    <form action="page2.php" method="post">
    <input type="checkbox" value="true" name="ch1">
    </form>

    on page2:

    echo $_POST["ch1"];

  6. #16
    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

    From looking at the script, that wasn't - as far as I can see, taken into consideration.

    Try contacting the author.
    - John
    ________________________

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

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

    Default

    My sincerest apologies for not replying, my junk mail filter was hating dd mail. Anyway, in response to questions, the code generates a hidden input field with a name specified as a parameter to the .init() method of the tristate class. Therefore, when the containing form is submitted, the value is passed along with the rest of the form.

    The value of the input field changes as the checkbox does, with -1 being a negative value, 0 being unset, and +1 being a checked box.

    My apologies for not maintaining the links, have had a bit of a reshuffle around here. All links will stay as jscheuer1 said for the forseeable future.

  8. #18
    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

    So, just to clarify this for others, on your demo page this hidden input's name is:

    testtristate

    from the config:

    Code:
      <script type="text/javascript">
    	var testCheck1 = new TriStateBox();
    	testCheck1.init(document.getElementById("testingtristatecontainer"),"testtristate","testCheck1",0);
      </script>
    In this manner each new TriStateBox() can, and probably should (unless multiple TriStates are to affect the same named value) have its own hidden input to hold its value. The value (on your demo page - this would depend upon the images used) when unchecked is 0. When checked with a check mark, the value is 1. When checked with an x, the value is -1.

    Other matters related to this script are that the images it uses should be preloaded - And does it have a non-javascript fall back?

    Oh, and there still is no link I could find to the zip archive mentioned in your first post, so no easy way to get the code and images together.
    Last edited by jscheuer1; 02-10-2008 at 04:27 PM. Reason: add info
    - John
    ________________________

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

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

    Default

    Currently there is no non-javascript fallback - obviously, upon implementation, you insert the code into the page as shown, and then directly after in <noscript> tags, you would put a fallback.

    The zip containing images and examples are at http://developingme.co.uk/uploads/tristate.zip

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
  •