Jump to content

Signatures arent storing in table


Recommended Posts

I have my dual signatures working on my submission form using the following code in my footer along with the other instructions found here.. https://forums.caspio.com/topic/6573-collecting-2-signatures/?page=0#comment-20486 but I don't think its storing anything into my table, the fields in the table are blank and when I try to display them onto a report using more code found in this forum nothing shows.  It's my understanding the table field should have a bunch or numbers and letters like coordinates?   Any help would be appreciated

 

<!-- Footer code -->
    <script type="text/javascript">
        $(document).ready(
            function ()
            {
                // TODO: Add your signature fields here in the order they appear on the form -->
                var signatureFields = [
                    ['Signature', [@field:Incident_Signature_Employee!], 'cbParamVirtual1'],
                    ['Formen_Signature', [@field:Incident_Signature_Foreman!], 'cbParamVirtual2'],
                ];

                for (var i = 0; i < signatureFields.length; i++)
                {
                    var api = $($('#cb_sign_wrapper_edit .sigPad')[i]).signaturePad({ drawOnly: true });
                    if (api)
                    {
                        api.regenerate(signatureFields[i][1]);
                    }
                }

                $('#cb_sign_wrapper_edit form').submit(
                    function ()
                    {
                        for (var i = 0; i < signatureFields.length; i++)
                        {
                            // Dump signature JSON data into hidden signature field
                            var newSignature = $('#cb_sign_wrapper_edit .output')[i].value;
                            $('#InsertRecord' + signatureFields[i][0])[0].value = newSignature;

                            // Capture each signature image into its corresponding [hidden] VIRTUAL field
                            var api = $($('#cb_sign_wrapper_edit .sigPad')[i]).signaturePad({ drawOnly: true });
                            if (api)
                            {
                                api.regenerate(newSignature);
                                $('#' + signatureFields[i][2]).val(api.getSignatureImage());
                            }
                        }
                    }
                );
            }
        );
    </script>
</div>

 

Link to comment
Share on other sites

I figured it out, the following code was wrong, I needed to make 'Signature' and 'Foremen, Signature' the same as my field names

// TODO: Add your signature fields here in the order they appear on the form -->
                var signatureFields = [
                    ['Signature', [@field:Incident_Signature_Employee!], 'cbParamVirtual1'],
                    ['Formen_Signature', [@field:Incident_Signature_Foreman!], 'cbParamVirtual2'],
Link to comment
Share on other sites

  • 1 year later...

It really just happens, it also happened to me. You really need to do the EXACT same thing as what the instructions told you to so. Any missed details will result into a lot of frustrations. 

Anyway, if ever you will land in this article, feel free to be redirected here: https://forums.caspio.com/topic/4693-js-adding-a-digital-signature-to-a-submission-form/?do=getNewComment

Link to comment
Share on other sites

  • 1 year later...
  • 3 years later...

Hi - FYI for issues or troubleshooting in applying Signature Pad.

- Signature Pad not showing/working
- If you encounter an error in the console that says $(...) signaturePad is not a function
- MIME type ('text/html') is not executable

 

Sign.jpg?ver=1
 

Things to check/troubleshoot:
- Make sure to download the file from the forum post above and be able to set it as a File parameter (unzip the file first)
- Make sure that you called/inserted the right parameter name in the DataPage.
- If it is a Report DataPage with Search Form, make sure to also include the file and jQuery in the Search form configuration

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...