Skip Navigation

[Résolu] Is it possible to hide the *clear form* until after a search is performed?

This support ticket is created Il y a 7 années et 4 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: America/New_York (GMT-04:00)

Marqué : 

This topic contains 5 réponses, has 2 voix.

Last updated by joshM-4 Il y a 7 années et 4 mois.

Assisted by: Tia.

Auteur
Publications
#459474

I am trying to: hide the clear form button until after a search is performed. Is this possible

I visited this URL: hidden link

I expected to see:

Instead, I got:

Do any of the css classes or parameters change in the view when a search is performed that I could use to target with css? Or if you have a php function or bit of jQuery for this that would be excellent too. Something that's built in would be best of all...

Thanks for your help!

#459550

Tia
no-clear.jpg

Thank you for contacting Toolset Support. I am happy to help you with this.

I do not see a "clear form"? Did you figure this out?

Let me know if I misunderstood.

#459569

The reset form button is there now.

The real question is if it can be set to only show after a search has been performed. Is that possible? That's what I'm looking to do.

Thanks in advance!

#459691

Tia

Thanks for displaying the button. Let me run a few quick tests and I'll get back with you.

#460037

Tia

Normally we don't support custom coding but I did want to at least give you some direction with this.

When a search is performed there is a div where the results display. The ID is:

#wpv-view-layout-156-TCPID9

The reset button has a class of:

.js-wpv-reset-trigger

I thought this would be easy testing but unfortunately it is a bit more involving than what I expected.

What you need to do is:

1. create a jQuery event to listen when #wpv-view-layout-156-TCPID9 is displayed.

2. tell that part of the code to display .js-wpv-reset-trigger

There are a few things I tried. But unfortunately without really digging in I just cannot debug this properly.

Here are a few things I tried. Hopefully this helps:

jQuery("#wpv-view-layout-156-TCPID9").live({
    if ( $('#wpv-view-layout-156-TCPID9').is(":visible") ) {
    	$('.js-wpv-reset-trigger').show();
    }
});
jQuery("#wpv-view-layout-156-TCPID9").live({
jQuery('#wpv-view-layout-156-TCPID9:visible').livequery(function() {
    $('.js-wpv-reset-trigger').show();
});
});

I also found a few resources that should help you put a final solution together:

http://stackoverflow.com/questions/1225102/jquery-event-to-trigger-action-when-a-div-is-made-visible

http://stackoverflow.com/questions/2262480/jquery-live-hover

http://stackoverflow.com/questions/27513115/hiding-div-while-making-ajax-call-with-jquery-for-a-smooth-experience

#460251

You're awesome. I appreciate the leads and will work on it for here. I bet I can get it figured out.

Thanks again!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.