Monday, June 28, 2010

Making "Post" and "Get" forms from SharePoint’s pages !

If you’ve tried to insert a form into a sharepoint’s page you mus have been disappointed. The form just didn’t work. You can’t make the form to post or get to some url, because the whole SharePoint’s page is one big <form> element.

So I went a bit deeper on how Microsoft guys are doing it on their spaces site (blog this functionality makes a post to a certain url) and based on this, I’ve made this simple script to make “forms” to post and to submit.

Update (5.11.): Unfortunately this method works straight only in IE, because it’s the only one that coppies the innerHTML with the changes (input data). So to get this method to work in FF, Chrome, Safari, Opera,.. you have to copy the field values. Here’s how

After the line

var formToSubmit = document.body.appendChild(theForm);

add code similar to the one below for copying the values for each of the input fields

No comments:

Post a Comment

About Me

A SharePoint Developer,I have worked for several consulting companies, and developed several SharePoint solutions. I have been awarded Application Development MCTS in MOSS from Microsoft on the May 2009.
And also I am a MS CRM Developer.
Please visit my MS CRM Blog
http://srikanthcrm.wordpress.com