Bojensen Blogs

Submit a form to outside website from sharepoint

Sending a form from to outside of a sharepoint implementation is a tedious task, so I am writing a jquery plugin to facilitate that job.

As most of .net applications (sharepoint being one of them) it wraps the html code with a form element. For some reason you cannot have a form inside of a form. One of the ways to solve is to add a javascript that reference the form outside of the main form element. There are some script that allow you to send form, but uses ajax and generate some crossposting errors. This script allow you to have a form inside of a form with small modification.

There are applications for this code like sending a form to a CRM system or any other system outside of the SharePoint.

Requirements

Load the jquery.js library and jquery.SharePointFormSubmit2.js

Version 2

I decide to replace with array instead of args, it make our life easier.

So you have a form like:

 

To use in SharePoint use the following changes in a Content Editor Web Part:

Note, there is no <form> and <input type='submit'> , and the addition of <div> .

Old Version

Parameters

  • element – element that is wrapping the pseudo form
  • method – post / get
  • action – the url where the information will be submitted

Example

Let’s say you have a form like bellow and you want to put in the Content Editor Web Part (CEWP).

It is well know the CEWP doesn’t allow to add a form, that’s the reason I create this jQuery plugin. To make the <form> above work in sharepoint, you will need to remove the form tag and replace the submit button with a onclick event. Like the example bellow:

jquerysharepointform – Submit a form to outside website from sharepoint – Google Project Hosting

Comments are closed.