Skip Navigation

[Resolved] Recall custom script after form reset

This support ticket is created 3 years ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by kelvinL-2 3 years ago.

Assisted by: Minesh.

Author
Posts
#2284493
Screenshot 2022-02-05 at 10.35.08 PM.png
Screenshot 2022-02-05 at 10.34.46 PM.png

Dear Sir/Madam,

I have a View and there is a script to change the specific date to permanent

jQuery("td:contains('31/12/21')").text('permanent');

When I click the reset button, all specific date changed back to the date format, how can I recall the script when customer clicking the reset button?

Here is the code I make the reset button in View

[wpv-filter-reset reset_label="Reset" output="bootstrap"  class="btn-secondary"]
#2285427

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

If the target is that any date that contains value "31/12/21" that you change it to permanent then what if you add the following code to your view's JS section.

jQuery(document).ready(function($){
    jQuery("td:contains('31/12/21')").text('permanent');
});

Will that help?

#2285579

Dear Minesh,

I do able to change the date from 31/12/21 to permanent when the View is first time loaded but date will be resumed back to 31/12/21 when I click the reset button.

#2285609

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share problem URL where you added the view and admin access details so I can check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2285683

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've added the following code to your view's JS box:

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
  jQuery("td:contains('31/12/21')").text('永久');
	
});

Can you please confirm it works as expected.

#2287609

My issue is resolved now. Thank you!