Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to create list in SharePoint 2010 with the following requirements. When anybody will try to create new item it will have some kind of header and body. In header it will input for example name and in body will have 2 items(car and color). Also user need to have option add new car and automatically another body should start(car and color)(it is more less like the option in Infopaths form where user are adding new item). Do you have an idea how can I start this task?

THANKS

share|improve this question

2 Answers 2

I am pretty new to sharepoint but think you need to start with sharepoint designer if you have already created your list.

If the list and the body are set automatically you can either use the default options and remove the ability to edit them in from the new form or you can use a workflow to set them if you need to have different options available. Alternatively if you need them setting by the user then just leave them as is in the newform and ensure that the fields in the list are set correctly.

As for the adding of another car I think if you have a choice field you can set it to allow fill in choices which should do what you are asking for here.

share|improve this answer
    
The idea is to add New Item in this form(cars). Each item will have number of elements (for example colors and enginge). So first when user will click I want new item. First he will have static number of normal elements like your name and surname and them depend of his wish number of cars (add button - new car). I think I have to connect this with different list and connect somehow with lists but I dont know how to start. –  Dariusz Mar 15 '12 at 12:19
    
I agree that the place to start is SharePoint Designer (SPD). You can use SPD along with JQuery, ASP.NET, and the Client Object Model to build some very advanced interfaces. Here is a link to go with MrWhimppy's part of the answer. I will add an answer to help with how to give the user the option to create a new car from the primary new form. office.microsoft.com/en-us/sharepoint-designer-help/… –  Robert Kaucher Mar 16 '12 at 12:19

For the second part of your question about how to allow the user to add a new Car from the first new form there are a couple of problems that you need to solve.

  1. Bring up a dialog showing the user the new form for the Cars list. Here is a JavaScript function you can use to do that.

    //Of course you will need to edit this to fit your needs //and the address of your list. function openNewCarDialog(){ var options = { url:'https://sp2010.com/site/Lists/Cars/NewForm.aspx', width: 700, height: 700, dialogReturnValueCallback: dialogCallback }; SP.UI.ModalDialog.showModalDialog(options); } function dialogCallback(dialogResult, returnValue){ //Run the code to refresh the select box }

  2. If a new item is added to the Cars list how do you refresh the current new form's "Car" selection box without refreshing the entire form? I would suggest that you use a combination of JQuery and the Client Object Model. Use the Client Object Model to query the cars list for any new items not in the current select box and then use the JQuery function append() to add the new items to the selection list.

    $('#long-guid-of-select').append('Name of Car');

share|improve this answer
    
This might also be useful to lokk at. sharepoint.stackexchange.com/questions/13498/… –  Robert Kaucher Mar 16 '12 at 14:39
    
Thanks MrWhippy and Robert for help. I will start first to associate the Primary Key with the main list and then step by step add the funcionality. Have you ever tried some funcionality like this or you have seen someone that was sharing on the blog something like this? –  Dariusz Mar 19 '12 at 7:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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