Here are the test forms, with details following:
Form #1
Form #2 (with Signature_Drawn rule parameter)
Form #3 (without Signature_Drawn rule parameter)
What I need is for everything in the non-selected method section to be erased when the user switches from one method to the other, every time a switch is made.
If the user chooses to draw a signature, everything in Signature_File should be erased, and vice-versa.
Ideally, when the user is in the Signature_Drawn method section, the Submit button should be revealed as soon as the field has a value (e.g., when the user first lifts/releases stylus/finger/mouse), and the Submit button should be hidden when the user clicks the Clear button.
Currently, the Drawn image is not being cleared/erased when switching to File method, with all 3 signature plugins I’ve tried. Reloading the page or submitting the form does clear the sig field with all 3 plugins I’ve tried.
Currently, the File image preview is not being erased when switching to Drawn method. It doesn’t get removed after form submission, but does get removed on page reload (in my browsers anyway; I’m not deleting cookies or caches during tests). It is temporarily hidden after form submission, but if you switch to Drawn and then back to File, there it is. There may be a better way of doing the preview. Feel free to play around with that, as I’m not committed to any particular code.
Of course, failure to clear the file preview won’t result in it being sent, since the file selection itself is cleared, so this is more a matter of aesthetics than functionality.
Specific results with the 3 signature plugins follow.
Contact Form 7 Signature Addon:
1. Clear button must be clicked after initial page load or page must be reloaded in order to see/use the drawing box.
2. First click of Submit results in error prompt. Second Submit click results in successful send.
3. Email:
a.) When switching to File upload and clicking Submit for the first time, the Drawn signature is not sent; the File is sent normally.
b.) When switched from File to Drawn after having selected a file, then clicking Submit twice, the Drawn signature is sent; the File is not sent, since the selection is properly cleared (though the preview isn’t).
c.) When sig field is not empty and Submit is clicked once, then switch to File and attach a file, then Submit is clicked there (second total click), both signatures are sent.
d.) When sig field is empty, only the File is sent on the second Submit click.
So, at least it isn’t sending a blank Drawn attachment.
The above tests (Form #1) were without the Submit button being in a group.
Form #2 and Form #3 are after I put Submit in its own group.
4. Submit button will not show while in the Drawn method section when Signature_Drawn is one of the rules – i.e., the plugin doesn’t detect when the signature box has a value. I added an Accept checkbox to show the Submit button (must remove the Signature_Drawn parameter).
So, Form #2 prevents the Submit button from showing.
Form #3 does show Submit (obviously, even when sig field has no value and clicking Clear does not hide it; no joy).
The other 2 plugins yield identical results among themselves, except where noted*.
Signature Field For Contact Form 7 – CF7Sign
Digital Signature For Contact Form 7
1. Unlike the first plugin, the form is sent on first Submit button click.
2. Same as #3 above, except only one Submit click is required.
3. Oddly, when Signature_Drawn has value, clicking a different field (focus) shows the Submit button, effectively turning any field into an “Accept” checkbox. If the Submit button can be made to show as soon as the sig field has value, then there will be no need for the Accept checkbox workaround.
4. Unlike with the first plugin, clicking the Clear button hides the Submit button, as it should.
*5. The Digital Signature For Contact Form 7 email file attachment isn’t working – but, putting the tag in the message body instead provides a URL to view the image in browser.
I will be glad to create additional test forms for the other 2 signature plugins to show their behavior, if you want to install those.
I know this is a lengthy post, but I wanted to be detailed to aid in troubleshooting. Thank you for looking into this. Signature attachment is a great feature to have and I’m sure many of your users will appreciate it.