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 am running SharePoint 2010 Enterprise. I am relatively new to SP.

What I want to do is create a form for my Publishing Site for authenticated users to fill out.

I want the form to behave like any form on any public facing website. Once the users completes the form, I want the following to take place:

1) If there are validation errors, those errors should prevent the form from being submitted.

2) If there are no errors, the form is submitted and the user is redirected to another page.

3) The form data is written to the SharePoint list

4) An email with the data is sent to a designated email address.

To make this happen, I have done the following:

1) I've customized the list's form using InfoPath 2010, with custom validation

2) I've deployed and tested the form

3) I've started a workflow

The trouble is, I don't know what to do next.

Can I assign this workflow to a List form, or do I have to create a form in a form library in order to assign the workflow?

Is what I am trying to do based on a false premise, that I can emulate the behavior of a typical web form using SharePoint?

If so, what should I do instead?

share|improve this question
    
Are you using custom code for this, or Designer? –  NotVonKaiser Jun 14 '13 at 15:44

5 Answers 5

1.You can create a list to hold the data, and let user to add data by list's default add form.
2.You can customize the form by Infopath.
3.Add a workflow to the list.(You can use Sharepoint Designer) Set the start option to every item is created, in this workflow, send a mail to the user.

share|improve this answer

Despite the previous answers, I feel compelled to point you in the opposite direction :-)

Depending on the complexity of your form, and your proficiency with ASP.Net, you should strongly consider editing your form with SharePoint Designer instead of InfoPath 2010. The effort is not that much more involved, and it will integrate much more seamlessly, with none of the drawbacks of an old, outdated, non-standards compliant and impossible to maintain and evolve technology that is InfoPath (What? No I don't have an ax to grind with it. Why do you ask??)

You can actually create a fully validated, list-backed ASP form in about 30 minutes when you know how:

  • First, create a Custom List. Add to it any columns as appropriate for the data you want to collect.
  • Navigate to that list, and in the List tab, click the SharePoint Designer icon.
  • Once in SPD, click on the New... button in the Forms section (we'll make a new one and hold on to the OOTB one until we're sure everything is working).
  • In that 'Create New List Form' dialog, select New item form, and the appropriate content type to use. Give the form a friendly name.
  • Back to the list view, click on your new form to open it in edit mode.
  • In Design mode, click the control you want to validate
  • In the Insert Tab, open the flyout menu for ASP.NET controls and find the Validation section
  • See this blog post for a description of the various validators available. As suggested in the text, you can simply copy-paste the ASP.NET markup in SharePoint Designer's Code view if you feel bold.
  • Edit the form to your liking. You can add most of the same stuff as with InfoPath, and more.

Save. Navigate to that URL. That's it!

  • If you set it as default, people will see that instead of the regular New form.
  • To navigate back to some other URL after submission, add 'source=someUrl' as suggested by David.
  • To open your form in one of SharePoint's modal dialogs, see example here (the first code block will get you the html markup you need)
  • For the email on submission, continue as you were doing with a workflow set to trigger on item creation, or a simple alert as David suggested.
share|improve this answer

Sounds like you are almost there, with two items remaining to solve.

1) Redirecting to a specific page when the form is complete.

This is most easily done with the source parameter in the form's URL. The value of this string is the URL the form is to redirect to when closed. Just add a link on a page somewhere that opens the new form you created with the source paramter in the URL.

2) Send the notification email.

If you are only needing to send an email when the form completes (adding an item to the list) I would add an alert to the list to send the email instead of a workflow. A workflow is over-kill to simply alert someone of a addition to a list.

A workflow becomes appropriate when there is logic to determine who to notify, what information is included or if a task (or series of tasks) is created in response to the form being completed and the status of the process needs to be tracked.

If a workflow is appropriate, how to get it to send the email depends on how your creating the workflow; in Designer and Visual Studio there are predefined actions to send emails and when working in Visual Studio the SPUtility.SendEMail method can be used.

share|improve this answer

You can start a workflow on a list item, which is basically what you are doing.

I dont see much wrong with what your doing right now. Looks like your on the right patch.

share|improve this answer
    
I assume you mean "path", but thanks for your answer. –  mmcglynn Jan 2 '12 at 23:14

You are well on your way. :)

You can create a forms library setting the form template to the form you have created. Then you can create and attach your workflow to the forms library (triggered by item created).

Depending on what information you are trying to collect or process you are trying to capture, surveys are often useful lists to gather user information too.

share|improve this answer

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.