Jan 26

“Security validation for this page is invalid”

Our SharePoint 2010 Enterprise environment was recently upgraded to SP1 and the June 2011 CU. Came in this morning to a error form an Infopath form. After checking it out, I got the same error myself when switching views on a browser form:

“The security Validation for this page is invalid. Click back in your Web Browser, refresh the page and try your operation again.”

Ran the error through el Goog and ran across this TechNet post pointing the finger at a new OnLoad event in the June CU. The August 2011 CU supposedly fixes (removes) it. But we’re not there yet, so here’s another way to bypass the problem:

  1. In the 14 hive, under template/layouts, find the formserver.aspx file.
  2. Backup the file and then edit it with any text tool, say, notepad.
  3.  Under the <body> tag, add the blue line of code.

<body runat=”server” id=”PageBody”>
<SharePoint:FormDigest runat=”server” />

 Save it and give the form another go, you should be good as new.


Jul 13

Infopath “Delete Row” button

Here’s a quick bit of code I found on Uday’s mstechblogs site that makes it a bit easier for your users to remove a row in a repeating table. 

 To use this in your form:

  • Add a button
  • Access the button properties
  • Fill out the Label and ID fields, then select “Edit Form Code…”
  • Find the code for your button’s clicked event
  • Add this short line of code after the comment line:
    • // Write your code here.

And that’s it. Preview your form and add a series of extra rows in the table. A click of your new button and the line will be gone. Makes things easier for end users; they just click a shiny button instead of using the table menu to remove each repeating row.

Jun 15

Auto-size Infopath drop down list

Found a solution to fix a drop-down list that is not sized correctly for the list items. If you go into the field property page and the size tab, empty the width field or type in “auto”. In some cases it will run the drop down arrow off the edge of the form, but it will still function correctly as a drop-down list when the field is clicked.


Drip-down auto size