I have several Fuel UX placards on a page, with a single jQuery selector to initialize them all. I need to write a custom onAccept
function to handle placard confirmation.
It seems like I should be able to access $(this)
from within the onAccept
to access the element being initialized, but it just points to the window
object.
How can I go about accessing the current element in a placard onAccept
function?
Here's my code for reference:
$(".select-user-placard").placard({explicit: true, onAccept: function (helpers) {
DMSC.UpdateUser(DMSC.SelectedForm.Id, $(this).data("field-type"), helpers.value);
}});
I need to call this function passing a parameter that is retrieved from a data-attribute on the element, but I'm not sure how I can access the current element without the use of this
.