jQuery for Everyone: Collapse or Prepopulate Form Fields
You may have seen the previous version of this script. At any rate, my goal was to create a script that required very little configuration and allowed prepopulation of any standard form field in SharePoint. This time, I’ve improved the look of “locked” fields as well as created a way to close or collapse a field, all from the URL.

For more information, examples, and an example web part, go to http://spff.codeplex.com/
- JQuery for Everyone: Accordion Left Nav
- JQuery for Everyone: Print (Any) Web Part
- JQuery for Everyone: HTML Calculated Column
- JQuery for Everyone: Dressing-up Links Pt1
- JQuery for Everyone: Dressing-up Links Pt2
- JQuery for Everyone: Dressing-up Links Pt3
- JQuery for Everyone: Cleaning Windows Pt1
- JQuery for Everyone: Cleaning Windows Pt2
- JQuery for Everyone: Fixing the Gantt View
- JQuery for Everyone: Dynamically Sizing Excel Web Parts
- JQuery for Everyone: Manually Resizing Web Parts
- JQuery for Everyone: Total Calculated Columns
- JQuery for Everyone: Total of Time Differences
- JQuery for Everyone: Fixing Configured Web Part Height
- JQuery for Everyone: Expand/Collapse All Groups
- JQuery for Everyone: Preview Pane for Multiple Lists
- JQuery for Everyone: Preview Pane for Calendar View
- JQuery for Everyone: Degrading Dynamic Script Loader
- JQuery for Everyone: Force Checkout
- JQuery for Everyone: Replacing [Today]
- JQuery for Everyone: Whether They Want It Or Not
- JQuery for Everyone: Linking the Attachment Icon
- JQuery for Everyone: Aspect-Oriented Programming with jQuery
- JQuery for Everyone: AOP in Action - loadTip Gone Wild
- JQuery for Everyone: Wiki Outbound Links
- JQuery for Everyone: Collapse Text in List View
- JQuery for Everyone: AOP in Action - Clone List Header
- JQuery for Everyone: $.grep and calcHTML Revisited
- JQuery for Everyone: Evolution of the Preview
- JQuery for Everyone: Create a Client-Side Object Model
- JQuery for Everyone: Print (Any) Web Part(s) Plugin
- JQuery for Everyone: Minimal AOP and Elegant Modularity
- JQuery for Everyone: Cookies and Plugins
- JQuery for Everyone: Live Events vs. AOP
- JQuery for Everyone: Live Preview Pane
- JQuery for Everyone: Pre-populate Form Fields
- JQuery for Everyone: Get XML List Data with OWSSVR.DLL (RPC)
- Use Firebug in IE
- JQuery for Everyone: Extending OWS API for Calculated Columns
- JQuery for Everyone: Accordion Left-nav with Cookies Speed Test
- JQuery for Everyone: Email a List of People with OWS
- JQuery for Everyone: Faster than Document.Ready
- jQuery for Everyone: Collapse or Prepopulate Form Fields
- jQuery for Everyone: Hourly Summary Web Part
- jQuery for Everyone: "Read More..." On a Blog Site
- jQuery for Everyone: Slick Speed Test
- jQuery for Everyone: The SharePoint Game Changer
- JQuery For Everyone: Live LoadTip
You may find this interesting – I’d a need to prepopulate a form field and then hide it and the ‘Content Type’ drop down list for certain content types.
http://www.novolocus.com/2009/05/18/use-jquery-to-populate-and-hide-fields-in-an-editformaspx/
I also needed to remove options from the Content Type drop down for when it was visible. I don’t know if that might be a useful enhancement? Possibly a bit of specialist requirement…
I like the idea of a library of functions for this sort of functionality. Makes a lot of sense.
@Andy,
Good ideas. I’ve also received some feedback about validation enhancements. Maybe I can upgrade the initial release in the next couple of weeks before SPTechCon.
Thanks,
Paul
I’ve really been enjoying your series on using JQuery within Sharepoint! This is an interesting method and I was able to get it to work but have a need to include the fields I wish to populate/hide directly within the CEWP instead of using URL query strings. Any ideas?
Hi PAUL,
This is ang owsome JQuery script.. BIG THANKS..
I have something here that this script I think having problem on converting..
Ex.
Men’s
Right one.
(Men%E2%80%99s)
Don’t understand this
(Men%u2019s)
Any idea why?
thanks!
Hey Paul. Thanks for this! I downloaded the script, uploaded into a script library on our site, and create a web part out of it. Now I just have to drop my jQuery web part on a form, then drop the spff web part right under it and, DONE!
So far I’ve used this to:
1) create project tasks from support requests (across two different sites)
2) make a copy of a project task.
Lots more ideas. Your solution let’s me solve problems! Much appreciated!
Tony