Hello, does anybody know how to modify the form to avoid the necessity of the submit button. My customer prefer the onchange method on the select list.
Thank's!
Pol Maresma PolNetwork.com / Serveis d'Internet pol(a)polnetwork.com msn: marolijo
Hi You can modify the HTML document with javascript and include the onchange method and exclude the submit button too. Thus you can assure accessibility in your site
Ramon
2009/1/23 Marolijo / Pol Maresma marolijo@yahoo.es:
Hello, does anybody know how to modify the form to avoid the necessity of the submit button. My customer prefer the onchange method on the select list.
Thank's!
Thank's! I tried this solution but the form isn't a simple html template on the module. It's created via Drupal form system, I'm lookin' how to do that.
Thank's!
-----Mensaje original----- De: support-bounces@drupal.org [mailto:support-bounces@drupal.org] En nombre de Ramon Vilar Gavaldà Enviado el: viernes, 23 de enero de 2009 13:46 Para: support@drupal.org Asunto: Re: [support] Views filter block without "send" button
Hi You can modify the HTML document with javascript and include the onchange method and exclude the submit button too. Thus you can assure accessibility in your site
Ramon
2009/1/23 Marolijo / Pol Maresma marolijo@yahoo.es:
Hello, does anybody know how to modify the form to avoid the necessity of the submit button. My customer prefer the onchange method on the select list.
Thank's!
-- Ramon Vilar Gavaldà - http://ramonvilar.facil.cat - http://blog.facilitant.net Membre de FÀCIL - http://www.facil.cat Membre de l'esplai SESA - http://www.esplaisesa.org -- [ Drupal support list | http://lists.drupal.org/ ]
__________ Información de NOD32, revisión 3791 (20090122) __________
Este mensaje ha sido analizado con NOD32 antivirus system http://www.nod32.com
Quoting Marolijo / Pol Maresma marolijo@yahoo.es:
Thank's! I tried this solution but the form isn't a simple html template on the module. It's created via Drupal form system, I'm lookin' how to do that.
See http://api.drupal.org/api/file/developer/topics/forms_api_reference.html#aha...
-- Earnie http://r-feed.com Make a Drupal difference and review core patches.
I tied this without luck... Any idea? Thank's!
function theme_views_filterblock($form) { $view = $form['view']['#value'];
// make the 'q' come first $output = drupal_render($form['q']);
foreach ($view->exposed_filter as $count => $filter) { $newform["fieldset$count"] = array( '#type' => 'fieldset', '#title' => $filter['label'], '#collapsible' => true, '#weight' => $count - 1000, // we'll never have this many filters
'#ahah' => array( // this is what I added 'change' => 'submit', // this is what I added ), // this is what I added
); $newform["fieldset$count"]['#collapsed'] = TRUE; } ...
-----Mensaje original----- De: support-bounces@drupal.org [mailto:support-bounces@drupal.org] En nombre de Marolijo / Pol Maresma Enviado el: viernes, 23 de enero de 2009 14:25 Para: support@drupal.org Asunto: Re: [support] Views filter block without "send" button
Thank's! I tried this solution but the form isn't a simple html template on the module. It's created via Drupal form system, I'm lookin' how to do that.
Thank's!
-----Mensaje original----- De: support-bounces@drupal.org [mailto:support-bounces@drupal.org] En nombre de Ramon Vilar Gavaldà Enviado el: viernes, 23 de enero de 2009 13:46 Para: support@drupal.org Asunto: Re: [support] Views filter block without "send" button
Hi You can modify the HTML document with javascript and include the onchange method and exclude the submit button too. Thus you can assure accessibility in your site
Ramon
2009/1/23 Marolijo / Pol Maresma marolijo@yahoo.es:
Hello, does anybody know how to modify the form to avoid the necessity of the submit button. My customer prefer the onchange method on the select list.
Thank's!
-- Ramon Vilar Gavaldà - http://ramonvilar.facil.cat - http://blog.facilitant.net Membre de FÀCIL - http://www.facil.cat Membre de l'esplai SESA - http://www.esplaisesa.org -- [ Drupal support list | http://lists.drupal.org/ ]
__________ Información de NOD32, revisión 3791 (20090122) __________
Este mensaje ha sido analizado con NOD32 antivirus system http://www.nod32.com
-- [ Drupal support list | http://lists.drupal.org/ ]
__________ Información de NOD32, revisión 3791 (20090122) __________
Este mensaje ha sido analizado con NOD32 antivirus system http://www.nod32.com
Marolijo / Pol Maresma wrote:
Hello, does anybody know how to modify the form to avoid the necessity of the submit button. My customer prefer the onchange method on the select list.
Thank's!
This is a script I was playing with. It's not really very well tested, I didn't really finish what I wanted. In particular it needs more smarts with textfields, I think, but if everything you have are select/radios then it works fairly well.
Add this to your theme via the 'scripts' command of the .info file:
--- views-exposed.js --- /** * Allow exposed filters to submit on change, rather than when the apply * button is clicked. */
Drupal.ExposedViews = {};
// This contains a list of views to apply this to. Drupal.ExposedViews.views = [ // This is in the format of 'form#views-exposed-form-VIEWNAME-DISPLAYID // and that all _ are converted to - in CSS IDs. 'form#views-exposed-form-fugazi-block-1', 'form#views-exposed-form-exposed-test-page' ]; // You can add as many views as you like to that list, but remember that // the last one should not have a comma after it, but all others should, // like this:
// var views = [ // 'view1', // 'view2' // ];
/** * Attach change behavior to forms. */ Drupal.behaviors.ExposedViews = function(location) { for (i in Drupal.ExposedViews.views) { var $view = $(Drupal.ExposedViews.views[i], location); $view.filter(':not(.views-exposed-processed)') .addClass('views-exposed-processed') .each(function() { var $form = $(this); $('input[type="submit"]', $form).hide(); $('select, input', $form).change(function() { $($form).trigger('submit'); }); }); } }