PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

All should toggle off when a categor(ies) is selected

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • All should toggle off when a categor(ies) is selected

    [ZOOM V5, JavaScript]

    Shouldn't the "All" check box automatically toggle off when the user selects the first (one or more) category?

    Could you provide an edit (I assume for the search.js file) for me to activate this feature?


    Thanks,
    Leon

  • #2
    It would have been a nice feature, and we definitely thought about it at the time of design, but it requires client-side Javascripting to do that, and that's something we try to avoid as it increases the likelihood of conflicts and incompatibility with people who might be employing the use of other Javascripts on their page (eg. Javascript navigation menus, scrolling boxes and ads, etc.).

    This issue is already evident with the number of questions we receive from beginner web designers who run into problems using our optional "jump to highlighting" script on their pages which are littered with other random Javascripts they have copied and pasted from across the Internet, that they do not really understand (and thus are unable to debug when conflicts - which are almost inevitable - occur).

    Couple this with the fact that users can currently create/design their own search form (wherein the JS we provide may no longer work), and that our existing server-side options (PHP, ASP, and CGI) do not use any client-side JS (and we want to keep it that way for the reasons mentioned above) - it is unlikely that we would add this feature.

    Nonetheless, it is something that would not be too hard to add (to the "search.html" page for the JS version, or "search_template.html" page for PHP/ASP/CGI). You will find many examples online, in web design tutorials etc. like the following:

    "Controlling checkboxes with Javascript":
    http://www.developertutorials.com/tu...629/page1.html

    "Checkbox changer":
    http://javascript.internet.com/forms...x-changer.html
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Thanks for the tip, Ray.

      I've already used the help (from communitymx.com) for the multiple column list treatment for my 14 categories. It works great!


      Leon

      Comment


      • #4
        Unfortunately, Ray, these solutions seem to work with established checkboxes that you can name and then manipulate. Since the zoom_cat[] delivers them dynamically, I doubt that these solutions would work.

        I'm not sure what you mean when you say that more client-side JavaScript would be problematic; near as I can see, the fix would be in the 959-line search.js that you folks already supply. That is, how to change (cat[0] = -1) to checked=false when any (cat[0] != -1) is selected. I tried a few things, but failed miserably. Am I wrong?

        My usability guru and my docteam people are on my case about this issue. We have another 4-6 weeks before our beta ships, so could I request this feature for a future patch, hopefully the next one?


        Leon

        Comment


        • #5
          Originally posted by MergeThis View Post
          Unfortunately, Ray, these solutions seem to work with established checkboxes that you can name and then manipulate. Since the zoom_cat[] delivers them dynamically, I doubt that these solutions would work.
          You can create your own search form (with named checkboxes) as described here:
          http://www.wrensoft.com/zoom/support...tml#searchform

          But you could also have your Javascript check the value of each checkbox item named "zoom_cat[]" and determine what to check/uncheck accordingly. For example, the "All" category is named "zoom_cat[]" but always has a value of -1.

          Originally posted by MergeThis View Post
          I'm not sure what you mean when you say that more client-side JavaScript would be problematic; near as I can see, the fix would be in the 959-line search.js that you folks already supply. That is, how to change (cat[0] = -1) to checked=false when any (cat[0] != -1) is selected. I tried a few things, but failed miserably. Am I wrong?
          The manipulation of the checkboxes in the current script is only done at the time of the page's output. That is, when a search query is made, it pre-selects the option by creating the HTML with that checkbox option set to "checked=true". This means that it can only change the form when the search page is reloaded - usually by hitting the "Submit" button.

          What I believe you were asking for, is Javascript that intercepts user input and dynamically change the checkbox options without reloading the page. This is very different, and the reasons we do not provide this is explained in my previous post.

          If you actually just want the "All" checkbox to be ignored when another checkbox has been selected (the current behaviour is the opposite - the "All" category overrides the other categories selected), then yes, this would be a much easier change in the script. But note that this would not uncheck the "All" checkbox dynamically - it would only be ignored in the search, and only after hitting the "Submit" button, and the page reloads, would the option be unchecked. Is this what you actually want?
          --Ray
          Wrensoft Web Software
          Sydney, Australia
          Zoom Search Engine

          Comment


          • #6
            Ray:

            The issue is that if users want to restrict their search to one or more of 14 categories I've configured, they're not likely to notice that the All selection has not been cleared. Therefore, they'll receive the same set of results as if they had not selected them.

            So, what I want is for the All check box to be cleared upon the selection of one or more "others." I can include instructions to clear the All button first, but hey, who actually reads this stuff, anyway?

            As to creating my own form, such as a dropdown with multiple selections (select multiple="multiple"), is it as simple as adding that form between the "Results per page" and "Match" elements shown in your FAQ section, and then selecting "Do not generate" for the search form on the Search Page tab?


            Leon

            Comment


            • #7
              Originally posted by MergeThis View Post
              The issue is that if users want to restrict their search to one or more of 14 categories I've configured, they're not likely to notice that the All selection has not been cleared. Therefore, they'll receive the same set of results as if they had not selected them.
              Yes, I can imagine that being an issue. At best, we can consider adding an option to allow a category checkbox to override the "All" option, as opposed to the opposite (which is the current behaviour). This means that when a user has both the "All" checkbox + another category checkbox selected, and when he/she click "Submit", Zoom will consider that to be a search for the category rather than the "All" option. But clearing the checkbox immediately (the very moment someone clicks on a category checkbox) would still require some custom JS.

              Originally posted by MergeThis View Post
              As to creating my own form, such as a dropdown with multiple selections (select multiple="multiple"), is it as simple as adding that form between the "Results per page" and "Match" elements shown in your FAQ section, and then selecting "Do not generate" for the search form on the Search Page tab?
              Yes, more or less, although the bit you're referring to is simply the dropdown box HTML for the "Results per page" option. While a multiple select box is similar in HTML, you will obviously need to change the values of the options to match the categories. I would recommend looking up a HTML reference or tutorial for more information.
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment

              Working...
              X