In hidden link, jQuery seems to be resetted when search form is resetted, but there is no event handler to restore jQuery?
Hi,
Thank you for contacting us and I'd be happy to assist.
From looking into the page's code, I noticed this custom script is included through the template's "JS editor":
jQuery(document).ready(function($) {
$('form[id^="cred_form_4485"]').on('submit', function() {
$(this).closest('.archiveintrag').hide(1500);
});
});
jQuery(document).on('js_event_wpv_pagination_completed', function(event, data) {
$('form[id^="cred_form_4485"]').on('submit', function() {
$(this).closest('.archiveintrag').hide(1500);
});
});
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
$('form[id^="cred_form_4485"]').on('submit', function() {
$(this).closest('.archiveintrag').hide(1500);
});
});
Only the first instance of the script function is properly using the jQuery in safe/compatibility mode.
( ref: hidden link )
To fix it, you can update the script, so that it covers all 3 events ( "ready", "js_event_wpv_pagination_completed", and "js_event_wpv_parametric_search_form_updated" ) from a single function:
jQuery( document ).on( 'ready js_event_wpv_pagination_completed js_event_wpv_parametric_search_form_updated', function( event, data ) {
jQuery('form[id^="cred_form_4485"]').on('submit', function() {
jQuery(this).closest('.archiveintrag').hide(1500);
});
});
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thank you, Waqar.
But this doesn´t help.
E.g. on hidden link, pressing "Biete" will make that button yellow.
After resetting that form, that doesn´t work anymore.
Thanks for writing back.
During troubleshooting, I noticed that as soon as the reset button is used, there is a script error generated in the browser's console, which originates from this part of the custom code:
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
$('form[id^="cred_form_4485"]').on('submit', function() {
$(this).closest('.archiveintrag').hide(1500);
});
When a script error like this is encountered, it stops any further execution of scripts. This is why I suggested the changes in the script, in my last message.
You can either make those changes from my last message or at least replace the "$" with "jQuery" in the code snippet, mentioned above and then check the working of the other custom scripts again.
I hope this explanation will make it more clear.
Ok, sorry. I´m lacking experience...
THANK YOU, WAQAR 🙂