Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: Setting CAMLQuery for SPServices GetListItems within Sharepoint Forms Designer

From within SharePoint Forms Designer I'm trying to populate some text boxes based upon a drop down list. I'm trying to use jQuery and SPServices GetListItems to accomplish this. I'm already using the SPCascadeDropdowns on the same page with success.

I'm trying to set the CAMLQuery string for the service call and it will not parse and I get a javascript error when the page loads.

Any help would be greatly appreciated....thanks in advance.

Error Message: Expected ';'

Code Sample:

$(document).ready(function() {

      $('.callname').live('change', function(){
                   
                    var selectedValue = $('.callname option:selected').text();
                   
                   
                    var test = "<Query>" +
                        "<Where>" +
                            "<Eq>" +
                                "<FieldRef Name='Title' /><Value Type='Text'>Bob Tester</Value>" +
                            "</Eq>" +
                        "</Where>" +
                    "</Query>";                                  
                   
                    $().SPServices({
                    operation: "GetListItems",
                    async: false,
                    listName: "Plant Personnel",                   
                    CAMLRowLimit: 1,
                    CAMLQuery: test,                                      
                    completefunc: function (xData, Status) {
                        alert(xData);
                        $(xData.responseXML).SPFilterNode("z:row").each(function(){
        
                        });
                    }
                    });

      });
               
 });


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>