Can you advise A CSS script to disable Square

Hi Quickfile

I saw a recent post where you provided a script for Stripe. I would also like to this for Square.

Many thanks in advance.

Stripe:
$(document).ready(function() {
//Set Disable Stripe as Default
$(".page-clients-modify #chkpspRestrict_E").prop(“checked”,true);
});

The chkpspRestrict_E is the critical bit in this script, the id of the checkbox for Stripe. You need to use the “inspect element” function in your browser to find the equivalent id of the checkbox for Square and edit the #… selector to match.

2 Likes

Thanks Ian

Is it possible that Quickfile can let me know the Square CSS string like you did for Stripe. I have no experience in this.

I can’t because I don’t have Square set up on my account but I can talk you through exactly how to find it out. You need to go to the “create new client” page, then right-click (or two fingers/ctrl-click on Mac) on the relevant checkbox, then “inspect element” - or some browsers just call it “inspect”. Here’s an example with a different checkbox:

Screen Recording 2021-11-27 at 11.43.17b

This will open either a separate popup window or a panel on one edge of your main browser window showing the HTML tree with the highlight on the element you inspected, you need to look for the id attribute:

Once you know what it is, the custom script would be

$(function() {
  //Set Disable Square as Default
  $(".page-clients-modify #{the id you just found}").prop("checked",true);
});

For example, if I wanted to tick the “allow attach PDF” box that I inspected above I’d say

$(function() {
  //Set enable attach PDF as Default
  $(".page-clients-modify #chkallowAttachPDF").prop("checked",true);
});

P.S. I’ve switched from the now deprecated $(document).ready(function() { }); style to the simpler $(function() { }); that is now recommended by the jQuery library.

1 Like

Perfect! Thanks so much Ian…all working ; )

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