Scenario: While adding item to the list, a new subsite will be created with list item title and description by using javascript.

Currently I'm working on NewForm.aspx page. I have added button(not in ribbon .. took spForm action button on form) to this page. When user click on this button, item will added to list and at the same time I need to create subsite with list item title and description.

We are using SP 2010

How can we write js for doint this? Please help to solve this.

  • You really need to add much more details to this question for it to be answerable Feb 28, 2014 at 10:32
  • Hi Robert .. I just modified my post... Hope u understand my issue now. Thank you Feb 28, 2014 at 10:58
  • This needs to be done with javascript? No eventreceivers? What version of SharePoint are you using (2010 or 2013 e.g)? Feb 28, 2014 at 11:00
  • Yes robert... we should use js only.. No event receivers. and we are currently working on sp 2010 Feb 28, 2014 at 11:06
  • SP2010 meaning you don't have access to the JS Object Model, will make this a challenge to do from JavaScript. Can't you use server side code because you must already be adding that button somehow to that form, no ? Feb 28, 2014 at 12:02

1 Answer 1


JSOM SP10 MSDN Put the js on the newForm page itself. When the save button is clicked, use JSOM to create a subsite and pull the title from the text field on the form. For a start on how to do this check basic site tasks here: MSDN basic sp operations w/ jsom

  • You need to AD more details about how to create a site with JSOM in 2010. Just linking to the JSOM page is not really very helpful at all Mar 1, 2014 at 9:13
  • If he wants to use JSOM then he should familiarize himself with the object model. Use the webCreationInformation object. Basically everything that you will want to do with JSOM is going to be in the SP namespace. Here is a link to the API. msdn.microsoft.com/en-us/library/office/jj246996.aspx It is layed out very plainly in the API. Many questions like this could be answered with basic programming knowledge and 15 minutes of reading a google search result. Mar 2, 2014 at 1:08

Your Answer

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

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