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 have an HTML5 + jQuery application with a built in contact form that I wanted to hook into Sharepoint, and Lists seemed an ideal way to do that. I used the jQuery library SPServices to get this up and running, and I thought it was working great with the following javascript code:

// Use Sharepoint list for adding data.
function CreateNewItem(name, email, phone, seat_chosen) { 

// Time to try to submit the form to Sharepoint!

$().SPServices({ 
    operation: "UpdateListItems", 
    async: false, 
    batchCmd: "New", 
    listName: "Form Contacts", 
    valuepairs: [["Title", name], ["Email", email], ["Phone", phone], ["Seat_Clicked", seat_chosen]], 
    completefunc: function(xData, status) { 

        if (status == "success") {
            alert ("Thank you, " + $("#contact_name").val() + ", for your inquiry!" );
        }
        else {
            alert ("Unable to submit your request at this time.");
        }

    }
});
} 

But it turned out that this only works if you are authenticated/logged in, even though the List permissions is set to allow Anyonymous Add Items. If you aren't logged in you just get that soul-crushing 401 (Unauthorized) message from _vti_bin/Lists.asmx.

I found various references to this problem in Googling, but they were all numerous years old and started back with Sharepoint 2007 and SPServices .5 (now using .7.2), and most trails end alluding to some future version or update they hope will fix this and then...the trail goes cold.

Is there some way to accomplish adding items to a list anonymously without allowing the contents of the list to be viewed publicly? If I need to use something other than SPServices I can, but custom alteration of Sharepoint itself or it's server-side code is not doable in this case.

I'm really, really trying to stick with javascript to get this accomplished for a multitude of reasons.

Thank you!

share|improve this question
add comment

1 Answer 1

This topic came up recently on the SPServices forum where some level of success was claimed. A bounty was even payed. Check this link out:

http://spservices.codeplex.com/discussions/354399

Paul

share|improve this answer
    
I am presently investigating this method. I'll post an update when I find out if it works for me! –  BrianDHall May 20 '13 at 16:27
add comment

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.