Jump to content

CBrazier

Circle Member
  • Posts

    1
  • Joined

  • Last visited

Reputation Activity

  1. Like
    CBrazier reacted to tuanphan in Adding Signature Box to Form for ID Verification   
    Signature is image or code or?
  2. Thanks
    CBrazier reacted to creedon in Would like to include the IP address of the person filling out a form   
    The following will require a business plan or above.
    Add the following to Settings > Advanced > Code Injection > HEADER.
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js" type="text/javascript"></script> Add the following to Page Settings > Advanced > PAGE HEADER CODE INJECTION.
    <script>   $( ( ) => {        /*            based on code from       < https://www.geeksforgeeks.org/how-to-get-client-ip-address-using-javascript/ >.              Uses ipify API < https://www.ipify.org/ >.              */            /*            Add "https://api.ipify.org?format=json" statement this will communicate with       the ipify servers in order to retrieve the IP address $.getJSON will load       JSON-encoded data from the server using a GET HTTP request              */             $.getJSON ( 'https://api.ipify.org?format=json', function ( data ) {            // setting hidden ip address field with name SQF_IP_ADDRESS              $( '[name="SQF_IP_ADDRESS"]' ).val ( data.ip );              } );            } );        </script> Add a hidden form field to your form named IP Address.

    That should do the trick. I tested it out here on a v7.0 site but I think it should work on v7.1 as well.
    Basically what this is doing is using Javascript/jQuery to go out and query the ipify api for the ip address of the client. Then stuff that number in the IP Address field.
    Obviously you will need to test on your site.
    Let us know how it goes.
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.