Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By euschenk on
I've got an exposed filter on one of my views which has the standard "apply" button. I'm wondering if there is a way to change the text on the button so that it says something other than "apply".
Comments
looking into this today
I was looking for some options for this as well and here are three resources that I found and used a combination of each....
http://fleetthought.com/blog-post/adding-reset-button-exposed-views-filters
http://stackoverflow.com/questions/451745/drupal-views2-exposed-form-how...
http://api.drupal.org/api/function/hook_form_alter
-=Sean=-
Also read
Also read http://drupal.org/node/320992
Specifically...
Specifically, see Comment #10 for instructions on doing this with a custom module and Comment #24 for doing it in your theme, and don't overlook Views' own
views-exposed-form.tpl.php
if you can do what you want with a template.Here is the solution
http://www.learn-drupal.in/drupal/how-to-change-apply-button-text-in-dru...
I found it
Hi here is the solution for your query
http://www.learn-drupal.in/drupal/how-to-change-apply-button-text-in-dru...
Thanks,
Sachin
I found it using CSS Only
I found it using CSS Only, and the good thing about CSS is that you can change the button text differently for different pages, which I was looking for.
The whole concept is to create a graphic background with the "text" you want the button to have and assign it as a background to the button. As well you have to minimize the text of the "apply button" to 1px or 0px(0px might be incompatable with some browser, check before) with the same kackground color as the grapfic you created.
something like this:
.views-exposed-widget .form-submit{
background:url(your/background.jpg) no-repeat;
font-size:1px
font-color: your-color;
}
Web Design In London
Regards
John
Do this
make a custom of this type
<?php
// $Id: template.php,v 1.4.2.4 2010/08/13 22:16:52 troy Exp $
function themename_preprocess_views_exposed_form(&$vars, $hook)
{
// change the id of form replace it with views-exposed-form-davinder-page-1
if ($vars['form']['#id'] == 'views-exposed-form-davinder-page-1') {
// Change the text on the submit button
$vars['form']['submit']['#value'] = t('Search');
// change the apply button to search
// Rebuild the rendered version (submit button, rest remains unchanged)
unset($vars['form']['submit']['#printed']);
$vars['button'] = drupal_render($vars['form']['submit']);
}
}
Do this
make a custom of this type
// $Id: template.php,v 1.4.2.4 2010/08/13 22:16:52 troy Exp $
function themename_preprocess_views_exposed_form(&$vars, $hook)
{
// change the id of form replace it with views-exposed-form-davinder-page-1
if ($vars['form']['#id'] == 'views-exposed-form-davinder-page-1') {
// Change the text on the submit button
$vars['form']['submit']['#value'] = t('Search');
// change the apply button to search
// Rebuild the rendered version (submit button, rest remains unchanged)
unset($vars['form']['submit']['#printed']);
$vars['button'] = drupal_render($vars['form']['submit']);
Drupal 7
If anyone is searching for how to do this in Drupal 7, I found it under Advanced, in the "Exposed form style" settings. No special coding or CSS required!
Haven't find this perticular settings
Can you please help to find this, I have not found in Views->Settings->Advance
This works for me! Thanks.
This works for me! Thanks.
[SOLVED] Drupal 7
Views Advanced Setting
Exposed form style:Setting
Submit button text *
Change "Apply"
Thank you!
Thank you!
Awesome!
That is very easy. Thx a lot!
[SOLVED] Drupal 7
Thanks!
Thanks!!!
Thanks!!!
Thanks! ^^
Thanks! ^^
Many thanks!
It also works in Drupal 8. Thanks a lot!!!
Re: Changing apply button for view filter
Thanks!