Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1063
  • Last Modified:

binding form fields to a different SharePoint list

SharePoint 2010

I have the standard CRUD for an SP list. However, I want the user to click a dropdown list and select a value. Based on the selected value, I want to use jQuery in a CEWP to dynamically show additional EMPTY fields based on the selection made that correspond to columns on another list. i can do all of the jQuery stuff, but I think the biggest problem is how to set up the binding for these fields so that they will submit the data to a different list on the same site collection, not the current list. I do not want to use InfoPath, if possible, as I understand this is being phased out. I do not want the additional data entered to show up on the list that launched the form and i would rather not have it associated with it at all, it is purely for entry convenience because one list's data should cause entries in another list.  It is possible and easy to use workflows to submit the data to the other list, but if those form fields are being dynamically generated via jQuery, and none of those values are being written to the current list, then the workflow doesn't have the data it needs.

So is it possible to set the binding in code for additional form fields, not bound to any column on the current list, to columns in another list instead? Seems like CQWP is good for viewing data from multiple lists, but not for submitting data to multiple lists simultaneously. I'm looking for a "binding" property and hoping I can enter in a column from another list rather than the current one. Don't know how the external address part of the other SP list would be handled as I'm sure I need that info provided, as well as the actual column name.
1 Solution
If I understand your question correctly, then I think you should be able to utilise Sharepoint 2010's ECMAScript to write data to a second list.  Provided you can get your UI working in jQuery, it should be relatively painless to insert into another list in the same site using this.

Here is a general overview - have a look and see if this fits the bill for what you want to do:

Here is an example of inserting into a list:

This technology is pretty much what Sharepoint 2013 apps are based on (jQuery + ECMA script) so it's worth investigation.
BobHavertyComhAuthor Commented:
I didn't have to time read through it all yet, but I can certainly understand it as I am familiar with the SP obj model and very familiar with Javascript and JSON, so I can figure this out. Didn't know that SP has it's own version of Javascript. and JSON  Looks like the right solution because it's lightweight, and as I understand it, SP 2013 does use a lot of this, and the article your linked was for SP 2010. So it looks like this is going to work and is the best way to do it given they eventually adapted it for 2013. Thanks.

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now