Skip Navigation

[Resuelto] Highlight search button when search form has changed?

This support ticket is created hace 7 años, 4 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 10:00 - - - - -
- - - - - - -

Supporter timezone: Africa/Cairo (GMT+02:00)

Etiquetado: ,

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Mohammed hace 7 años, 4 meses.

Asistido por: Mohammed.

Autor
Mensajes
#550602

a.R

My users often select search criteria and then wonder why nothing is happening. They just don´t press the search button.
So I would like to highlight the search button after users have changed search criteria.

How can I assign a CSS class to my search button on form change by JQUERY and then remove it again when search button is pressed?

THANK YOU - kind regards,

Achim

#550642

Hi,

I'm Mohammed, the Toolset support team leader. I will do my best to help you in your request.

I'm preparing a solution for you at the moment. please wait and I will get back to you ASAP.

Thanks.

#550650
submit button.png

Hi,

I've prepared a simple solution for you.

**At first, you will need to add an initial class to the submit button.
You can find an option to add a class while adding the submit button in the filter editor of the view. please check the attached screenshot.
In my example, I used the class "submit-button" and the final button output is like this

[wpv-filter-submit output="bootstrap" class="submit-button"]

**Then, you can use the following Jquery code to add a class to the submit button while changing the form inputs and remove it when you press the button.
*The following code can be added to the JS editor of the view.

jQuery( 'input, textarea, select' ).on( 'change', function() {
	jQuery( '.submit-button').addClass('myclass');
});

jQuery( '.submit-button' ).on( 'click', function() {
	jQuery( '.submit-button').removeClass('myclass');
});

Please let me know if this works with you.

Thanks