2

I've been struggling with this requirement for some time now and I can't seem to find a solution to what I assumed would be a fairly simple task.

What I'm trying to create is a form to submit data to sharepoint 2013 custom list. By default the form needs to expose fields for a single record, but also include an option to add another item without displaying a new page. i.e. data already entered in the form should remain visible when filling in the next set of fields.

What I have in mind is the user would click a button to add another entry at which point a new set of fields would be displayed. I can't predict how many additional records will be added, so the process of adding new items needs to be dynamicly controlled by the user as the form is filled in.

There are additional requirements which I only mention in case it impacts the answer. - some fields in the new record may need to be auto-filled (copied and/or calculated) based on data already entered in the form. - each new record section needs to have layout/display formatting applied

I have seen examples where similar capabilities have been implemented using sharepoint designer, at least the 2010 version, but I've not been able to replicate any examples using SPD 2013 (due to different options and depreciated functionality).

I've also seen many references to InfoPath but I'm trying to avoid using this because it's been discontinued. I realise it will be supported for a few years yet, but after that time it's likely that infoPath forms will need to be replaced which could be a big disruption to an active service.

In SPD 2013 I can see some options for creating repeating forms under: DATA VIEW TOOLS -> DESIGN -> View Style

As a simple test I created a new form for adding new items and set it as the default: Lists and Libraries -> [List] -> Forms -> New...

Editing this in advanced mode (as WYSIWYG mode no longer available) and position the cursor outside of the yellow highlighted sections to display the DATA VIEW TOOLS menu. I select the View Style as "Repeating Form" and save, but when I view it in browser I see no option to add a new item.

I've found very limited information about repeating forms in sharepoint designer 2013 and no solid examples.

I can see further options such as:

DATA VIEW TOOLS -> OPTIONS -> Paging -> - Display set of [1/5/10/30] items

But changing this seems to have no effect - in fact it seems to trigger some instability where on some occasions the page will no longer save after changing these settings.

Sorry for a lengthy question but I'm fairly new to sharepoint so I wanted to provide more info - I have a clear understanding of what I need to achieve but not such a clear understanding of how to do it! Is SPD the right solution for what I need - if so why don't I see expected behaviour? Is there a better alternative?

1 Answer 1

2

You can create standard html form with javascript. You can do with it what you want and write on list using Java Script Object Model on button click or something with javascript.

With this approach you can do with the form what you want. On button click you can write item on list and don't close the form, so you can reuse data putting next item on a list. Have a look on the section "Create a list item" with JavaScript: How to: Complete basic operations using JavaScript library code in SharePoint 2013

3
  • Exactly,if you have a high customized form, rewrite it by html and handle the item adding by JS (script content web part or custom web part) with CSOM
    – Nk SP
    Nov 12, 2014 at 13:10
  • Thanks for the quick responses - i didn't realise a plain html form could be used - i just assumed there were special hooks/layers added by sharepoint to interface to the list. the javascript approach seems ideal but the link provided just brings me back to this page - i ran a search and found this from MS: msdn.microsoft.com/en-us/library/office/… if you have another reference please do add the link
    – vince365
    Nov 12, 2014 at 13:43
  • I've got an additional question... My form has fields that currently pull in data from sharepoint - either from other SP lists or from centrally maintained data e.g. there is a field to specify the name of a person. When data is entered into this field the centrally administered employee list is searched. If I want to replace the original SP form with a custom HTML form and use javascript to write to the list, is it also possible to pull in the look-up behaviour for data entry using javescript? Do you know of any good examples showing how this can be done? Thanks
    – vince365
    Nov 12, 2014 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.