Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created a SharePoint app for a form with textarea boxes. Now I want to send all data that I have written in the textarea to SharePoint with javascript.

Every textarea have a unique ID and I have a list in SharePoint with columns where I want my data to be stored.

How can I connect my textarea boxes with my columns in my list?

share|improve this question
    
What kind of app? Provider or SharePoint-hosted? I want to assume SharePoint since you are using JavaScript. And where is the list? The host or the app web? If on the host the cross-domain library will be required. Other than that, it's simply retrieving the value from the textarea and using either JSOM or REST to submit the data. – wjervis Oct 20 '14 at 11:37
    
I solved it thanks anyway :) – linkan94 Oct 21 '14 at 7:51

1 Answer 1

Answer:

function setItems() {

var listCreationInformation = new SP.ListItemCreationInformation(), listItem = list.addItem(listCreationInformation);

listItem.set_item('GEN_1_Sum_Scope_Assigment', $('#GEN_1').val()); 
listItem.set_item('GEN_1_Sum_Scope_Assigment_D', $('#GEN_1_D').val());
listItem.set_item('GEN_2_CRMname', $('#GEN_2').val());
listItem.set_item('GEN_2_CRMname_D', $('#GEN_2_D').val());
listItem.update();

appContext.load(listItem);
appContext.executeQueryAsync(function (success) { alert("Din sparning lyckades!"); }, function (sender, args) { alert('Error:' + args.get_message()); });
}
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.