Hi,
I would like to ask for a new feature. When I access to a page with the shs and my browser is not supporting js, the shs is not working properly, being impossible to my users to continue ahead.
Would be great to add a non js browser support. For instance, the Hierarchical Select Taxonomy detect browser that don't support js, enabling a button to update the different levels of the hierarchy reloading the page to update the next level.
I do prefer SHS rather than HST, therefore I would love to have this functionality.
What do you think about this feature?
Thanks heaps
Javier
Comments
Comment #1
henrijs.seso commentedClosing my own #1975460: Use select element instead of textfield for fallback as this is older.
Compleatly agree. First step probably would be to use select element instead of textfield. Textfield makes field unusable with JS off. It is possible to base it on select element, it's should be not that hard/different. It would be much needed first step.
Comments? Should we try that?
Comment #2
javier.drupal.2012 commentedHi Mansspams,
IMO select box would be the best choice, I like the hierarchical select module solution. In this module there is a select box. If the taxonomy vocabulary has more than one level then they add a button to click and reload the page with the child terms of the selected term in the select box.
I can help you with some testing if you want. I'm glad to help.
Javier
Comment #3
henrijs.seso commentedI'm not thinking that far yet. Babysteps. Let's just change textfield to select to enable bare bones fallback if JS is off. As for new terms, levels and page reload, I'm not sure that will be easy task. Got to experiment.
Comment #4
stborchertDidn't know what I've tried before but it was a somehow very simple solution.
Committed to 7.x-1.x-dev so it will be available in the next development and full release.
Comment #5
henrijs.seso commented@stBorchert Did you test new select element with adding new terms? There could be a problem with validation (fix is also not hard). If select element returns value that was not been in that select element before, Drupal will set error "An illegal choice has been detected. Please contact the site administrator."
If you test and see this error, drop me a line here. I am writing new module that could provide ideas and solutions to SHS too.
Comment #6
stborchertThe features "add new terms" and "add new levels" are not available without JavaScript so I doubt there will be errors ;)
Comment #7
javier.drupal.2012 commentedThanks, I will wait for the next release
Javier
Comment #8
henrijs.seso commentedWait, but if JavaScript is enabled and new terms added, then form will still return values that were not in select element before. Even if terms are created with AJAX call.
Currently I am making custom module that does magic thing. I use FAPI multiple select element + fork of Chosen to create very simple (4 functions) fake autocomplete field with add term option.
My select element was angry that I tried submit form with values that were not known during
hook_field_widget_form(). It's because of_form_validate()thats gets called on all select elements. More info here...Anyway, for future reference:
Comment #9
stborchertThe special validation handling has been committed some time ago but your comment reminded me about some JavaScript I forgot to push: the new item needs to be appended to the original select so it can be set as value.
Thanks for the hint :)
Comment #11
pq commentedJust noticed that the views exposed filter widget gets given an
element-invisibleclass, meaning that the fallback select field is invisible by default and if javascript is disabled will never appear.Without that class it the fallback appears to work fine. I'm not sure if the class was added to prevent visual stutters but maybe it should be an option to either have it displayed by default for accessibility or hidden for better (with-js) UX but with a warning that it will break the fallback.