hello

i searched for one hour and i did't find something in the forum (i'm not a native speaker) - i'm sorry for this, but i have to ask this simple question: how to get an autosubmit for the select-fields of an exposed filter form.

thanks and greetings
momper

Comments

momper’s picture

hello

no solution?

thanks momper

merlinofchaos’s picture

You need to use a javascript onchange. Views doesn't support this natively, so a full "how to do it" answer here may not be forthcoming; unfortunately I don't have the time to provide a full walk through..

momper’s picture

momper’s picture

<script type="text/javascript">
$().ready(function()
{
$("form#views-exposed-form select").change(function() {
  $("form#views-exposed-form").submit();
});
});
</script>

this works - i'm not a selector-geek - so if somebody has a smarter way to this - you are invited for the most abstract solution with parents and childs and and and :)

momper’s picture

<script type="text/javascript">
$(document).ready(function()
{
$("form#views-exposed-form select").change(function() {
  $("form#views-exposed-form").submit();
});
});
</script>

... better with $(document).ready(function()

merlinofchaos’s picture

With jquery you can use $(functionname); as a synonym for ready() as well.

Otherwise, after a once over that looks like the way to go. This is the kind of thing that could use an entry on the views snippets page.

momper’s picture

Status: Active » Fixed

thanks again - i posted http://drupal.org/node/313790

first one - so i hope it's o.k. like this :) - and close this - if anybody has another idea - reopen ...

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

yakker’s picture

Thank you thank you thank you.
:D

agerson’s picture

$(document).ready(function()
{
$("form#views-exposed-form-calendar-calendar-1 #edit-submit").hide();
$("form#views-exposed-form-calendar-calendar-1 select").change(function() {
  $("form#views-exposed-form-calendar-calendar-1").submit();
});
});

This worked for me and hid the submit button

robby.smith’s picture

bookmarking - thanks!

hixster’s picture

subscribe

wooody’s picture

its not working... i got this error
An illegal choice has been detected. Please contact the site administrator