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
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.
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