229
Views
5
Comments
Using jquery to click() a link with Load style applied
Question

Hi all, 


I have a link with a method type of "Submit", and the Load class applied (to prevent double clicks)

When i try and click this link using jquery i.e. 

$( "#wt155_wtMainContent_wtGo" ).click();

the loader appears but the actual link isn't being triggered?

Any ideas how to fix this?


Thanks

Tom

2016-11-20 11-27-52
João Neves

Hi Tom,


Any errors in the browser console? 

UserImage.jpg
Tom C

No errors - see screenshot attached

UserImage.jpg
Tom C

Anybody got any ideas on this, would be appreciated?

Thanks

2022-07-07 18-45-50
Niels Favreau

Since you are using method type 'submit', it will not work. (if you are navigating to another page)

A link needs method navigate. 

You could create an link with css 'display : none;" applied to it. When you click on the button with type submit , run some javascript or jQuery to click on the hidden link with method navigate. Or u could use Widget_Click action available when referincing to it.

UserImage.jpg
Tom C

Niels, 

The method type of the link is submit because it points to a local action. Inside the local action there is some logic that is executed and then the last node is a destination node i.e. it goes to another page.

When i use the jquery to "click" this link the action doesn't run. Its because of the Load class, but not sure why this class prevents the click() method from working .


Tom


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.