Skip Navigation

[Resolved] trigger a view´s submit button by jquery

This support ticket is created 4 years, 5 months 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 7 replies, has 2 voices.

Last updated by a.R 4 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1714621

a.R

Hi.
On hidden link I am trying to trigger the "Suchen" (Search)-Button in the view on the left side by clicking on the blue "SUCH" button (middle bottom):

jQuery( document ).ready(function() {
$( 'button#suchtrigger' ).on( 'click', function() {jquery( ".sidebar1 input#suchknopf" ).trigger( "click" );})
})

... but instead of triggering the search, the page is simply reloaded.

What´s wrong here?

THANK YOU, kind regards!

Achim

#1714627

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As I understand - when page is loaded: hidden link
- You want to automatically click on the search button. If this is correct:

Can you please try to use the following JS code:

jQuery( document ).ready(function($) {
 $('[name="wpv_filter_submit"]').trigger('click');
});
#1718985

a.R

Hi Minesh, thank you.

Unfortunately it´s still the same with your code.
The VIEW should be submitted, when the trigger button is clicked.

Kind regards, Achim

#1719007

Minesh
Supporter

Languages: English (English )

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

Can I have access details so that I can check whats going wrong with your site.

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

#1720599

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

I've changed the JS code I shared as given under:

jQuery( document ).ready(function($) {
 $('[name="wpv_filter_submit"]').click();
});

I can see now submit button is automatically clicked.

#1720733

a.R

Ok, thank you. This works.
Now what I was trying to tell you: The search button should be triggered, when the BLUE TRIGGER BUTTON ("SUCH") is clicked.
I can try to achieve this with your help.

And WHERE DID YOU PUT YOUR CODE?

#1720739

Minesh
Supporter

Languages: English (English )

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

I've added the code to your view's JS box that is available within the section "Benutzerdefinierte Sucheinstellungen" editor.
=> hidden link

Now what I was trying to tell you: The search button should be triggered, when the BLUE TRIGGER BUTTON ("SUCH") is clicked.
I can try to achieve this with your help.
==>
I do not find any button with "SUCH" - can you please share screenshot where I can see that and what you want that button automatically clicked?

#1720903

a.R

My issue is resolved now. Thank you!