HOME / COMMUNITY Switch to knowledge base

Custom Scripts - chkSendPayConfirm

Hello

I have added $("#chkSendPayConfirm").attr("checked",true); to the Advanced Customisation - Custom Scripts. This does not seem to be working.

I would like the “Send payment confirmation by email” to be checked when tagging payments from the account statement views.

Thank You

Hi @syntaxlink

Do you have anything else in your custom script, or is it just that one line?

Yes

$("#chkattachPDF").attr(“checked”,true);
$("#chkSendPayConfirm").attr(“checked”,true);

The main problem you’ll be having is that the chkSendPayConfirm element doesn’t exist when the custom script runs - it is only created once the popup has been shown. So you need to find some way to delay the action until the element exists. Now it looks from the code like QuickFile uses the “facebox” library for its popups, and that publishes events you can hook into. So try something like:

// this event fires when the popup has become visible
$(document).on('reveal.facebox', function() {
  $("#chkSendPayConfirm").prop("checked",true);
});

(I’ve used prop rather than attr, which is more reliable for properties like “checked” and “disabled”)

1 Like

Hello

I forgot about the popup.
This works now.

Thank You

This topic was automatically closed after 7 days. New replies are no longer allowed.