This project has moved and is read-only. For the latest updates, please go here.

SPWebServices not getting called

Apr 5, 2013 at 4:52 AM
Hi Marc,

I've been trying for days to get this working on dataview form.

Set Up
  1. Custom Master Page
  2. Data View Form
  1. Expand size of the multiselect column
  2. Arrange choices horizontally

Arrange Choices
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript"> $(document).ready(function(){ alert("jQuery"); alert($().SPServices.SPGetCurrentSite()); $().SPServices.SPArrangeChoices({ columnName:"Request Type", perRow:6 }); }); </script> Result
In SP arrange choices, I get the message that jquery is loaded as well as the path to the SP site. But nothing happens and there is no error on the page.

<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript"> $(document).ready(function(){ alert("jQuery is loaded!"); $().SPServices.SPSetMultiSelectSizes({ multiSelectColumn:"Transactions" }); }); </script> Result
Same with MultiSelectSizes, I see the message but nothing happens, no error.

Actions Taken
  • I've added <xsl:comment> trick to both fields just above the SharePointFormField.
  • I've tried only one of the two above at any given time so there are no possibilities of conflict I believe.
  • Also tried the relative URL of the site in the jquery path starting /MSM but no luck.
  • I tried putting both the jquery files on the custom master page to see if that helps but no luck.
  • Removed $(document).ready(function(){ but no luck either.
  • Read almost all of the blogs around this topic but cannot figure out where the problem is.
  • I also added an alert after the SPwebservices call and I could get the alert as well.
I need your advice to please have this working.

Thanks a ton as always,
Apr 5, 2013 at 5:01 AM

Some more information.

I am using SharePoint 2010 and if it helps, I also tried adding the code on a custom NewForm.aspx with default master and it still did not work.

Apr 5, 2013 at 1:10 PM

If you've customized the form with a DVWP, then it's very hard to say what the issue is. Given that you are getting the two alerts, the js references are correct.

Have you tried setting things up on a non-customized version of the form? That's the best place to start. I don't know what other customizations you've needed to do.

Apr 6, 2013 at 7:23 AM
Thank you Marc for your quick response!

I tried it on a non customized form using the default.master and it works. Then I added the non customized form on a page created using my custom master page. It works there as well. So I think the problem is with my DVWP form. It is a basic question but I don't know if the SP services code looks for some kind of class to identify the fields and then do its magic. It apparently finds it on the listview non customized form but does not do it on my DVWP.

Would you please be able to guide?

Apr 6, 2013 at 12:27 PM
First step is to read the tips on the documentation page.