InfoPath– Getting the “Signature”

You can add real digital certificates to your InfoPath forms, but there are a few problems with them:

  • They are not compatible with browser-based forms
  • They don’t collect any real data that you can do anything with.

So, for most clients I work with, they don’t need to have “real” certificates involved, and simply need to capture a person’s name and the date that they are signing a form.

Here’s my solution, which I use some variation of in every single form I create:

  1. In your InfoPath form, in the Fields on the right, right click on myFields and choose Add
  2. For the Name, type SignatureGroup.  For Type, select Group.  Click OK.
    CropperCapture[62]
  3. Right-click on SignatureGroup, and click Add…
  4. For the Name, type SignatureCheck.  Click OK.
    CropperCapture[63]
  5. Just like in steps 3/4, create another field called SignatureName
  6. Right-click on SignatureGroup one more time, and click Add…
  7. Name this one SignatureDate, and for data type, select Date.  If you need date and time, you can choose DateTime.  Click OK.
  8. You can right click on any field on the right, and pick what type of control it needs to be.  Insert SignatureCheck as a check box, and insert SignatureName and SignatureDate as calculated values.  Type “I agree” next to the check box.  You can add any kind of extra verbiage that you need, such as “by signing this form, I agree to this… blah blah”  Your company’s lawyers can probably provide you with that part.  Winking smile
    CropperCapture[64]
    (Note: inserting those fields as calculated values is pretty much the same as inserting them as text boxes and then setting them to read only.  The point is that we don’t want people to be able to edit it.)
  9. Click to select the check box.  Open the check box properties.  Notice that by default, the value when cleared is no, and value when checked is yes.  These are important to remember, even the proper capitalization (all lowercase).  Close the properties, and open the rules pane on the right.
  10. With the check box still selected, Click the New button in the rules pane.  Choose Action.
  11. In the Details for box, type checked.  The condition needs to be that SignatureCheck is equal to yes.  Click OK.
    CropperCapture[65]
  12. Next to Run these actions, click the Add button.  Choose Set a field’s value.
  13. For the Field, choose SignatureName, and for the value, click the Function button and use the expression userName()   Click OK.
    CropperCapture[66]
  14. Click the Add button again, and this time the field is SignatureDate, and the function is today()
    (If you used DateTime at step 7, you need to use the now() function instead)
  15. Next, we can add another rule, so that if the box is UNchecked, it clears the values out.  Select the “checked” rule, and click the little Copy icon at the top of the rule pane.  Click the Paste icon.
  16. Call this next rule “Uncheck”, and change the condition so that SignatureCheck is not equal to yes.
  17. Click the first action, and just delete the function out of the Value box so it’s blank.  Do the same for the other action, so that we’re basically clearing out both SignatureName and SignatureDate so they’re blank.
    CropperCapture[67]
  18. Now test this out by clicking the Preview icon at the top.  Obviously you can make this prettier, but that part is up to you and your creativity.
    One more thing, is that you can disable the submit button if they do not check the box.  Click to select your Submit button.  Click the New button in the rules pane, and choose Formatting.
  19. Call this rule “disabled”.  The condition is if SignatureCheck is not equal to yes.  Click OK.
    CropperCapture[68]
  20. Still in the rule pane, check the Disable this control box at the bottom of your new rule.
    CropperCapture[69]

All done.  Now, if you don’t “sign” the document, you can’t submit it.  One thing to watch out for is the default submit button in the toolbar in InfoPath.  If you have this enabled, then people will be able to submit your form whether they signed it or not.  You can click the Data tab at the top, click Submit Options, and UNcheck the box for allow users to submit this form.  Now there will be no submit button in the toolbar.  You can also go to form options and remove the toolbar altogether if you want.

You’ll notice that when it captures your signature, it only gets your NT login name.  If you want to get all fancy and show a First Name, Last Name (which isn’t unique like the username), you could use the user profile service for that.  You can take a look at a recent post of mine to see how to obtain that information.

13 comments

  • Laura-

    Thanks very much for this post, just had a meeting yesterday about adding signatures to the forms on working on. Very timely.

    Ken Reid
    kjreid@yahoo.com

    Like

  • Love it!
    Keep up the good work.

    Like

  • Laura, my question may not be related to this blog. But I’ve a general InfoPath question for you !

    Can we add ‘SharePoint’ site columns (created through SP UI) to InfoPath Content Type ? I want the user to fill in some SP columns (site columns) while uploading the InfoPath form (based on a content type) !

    Summary: Created InfoPath form, promoted fields as SP columns and then published form as content type. Now I want to add some SP site columns to this content type manually !

    After adding these SP columns,I tried to upload InfoPath form. But I can not fill in these SP columns ??

    A quick thought of yours would be a great help !
    Thanks in advance

    Like

  • The signature in the InfoPath form is always a troublesome. Thanks Laura for such knowledgeable article. Good Work !!!

    Like

  • I have added the signature and approve area to my form, and works great. However, if someone clicks the checkbox for “Approve” and then say they change their mind for whatever reason, their signature and date stamp are still in the text box fields. Is there a way to disable that if they uncheck the box?
    Thanks!

    Like

  • John,
    It sounds like if you’re making them upload forms, that you’re doing something wrong in the first place. They should be submitting forms, not uploading them. Your library can have different forms, each based on a different content type. That way, each content type can have different fields associated. Just publish each form as a different content type, and then associate all of the multiple content types to the one form library. This makes me question… why content types? What’s the big picture / end goal here? Maybe there’s no reason to have multiple forms or content types. Maybe just a field indicating xyz whatever the difference is.

    Monique,
    Add another rule to the checkbox, similar to step 11. Signature is not equal to “yes”, then set each of the fields to empty.

    Like

  • Hi Laura,
    i need your suggestions and help to develop an infopath based application for the hospital management system
    can i have you email id

    Like

  • Sure Alen, you can contact us here about consulting discussions like that: http://sharepoint.rackspace.com/Contact

    Like

  • Hello Laura,

    I have a very peculiar query on uisng a picture as signature in an infopath form. When I add a new item in the list, some of the data (like user name, email id, signature image) need to be auto populated with current user’s data who has logged into the site. I am able to get the username. But image i am not sure. I tried by creating a new picture library and thought of the getting user’s signature auto populated along with other details.

    Is there a way to get the signature image auto populate in the new list window?

    Please do the needful.

    Thanks,
    Thirumal Reddy

    Like

  • Tirumal,

    One way to do this is to get small signature jpegs of everyone who would be “signing”. Then follow Laura’s signature routine.

    Now place each signature jpeg in it’s own section and stack them where the signature would appear.

    Now for each signature jpeg section you will HIDE the section if the signaturename doesn’t equal <insert NT login name.

    So once the person clicks the signature check box, thus entering their NT login name into that signature name text field, your rule would check to see if the section rule equals the name you want if it does then it appears.

    Like

  • It doesn’t seem possible to create a Group on a browser-based List form. Is that correct? If so is there another option to create a signature such as this?

    Like

  • You can insert a section (from the list of controls) on a browser based list form, and put the fields in that section, and create the formatting rule on it as well.

    Like

  • Hello, Add is grayed out when I right click on My Fields and it is grayed out at the bottom of the list also… Is there another way I can get the “signature” on my form? Thank you so much! Annie Straw

    Like

Leave a reply or question

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s