I am creating a SharePoint 2013 hosted app and I have come across a problem. I am able to submit everything to my list including a text box that say for instance may contain "this is a test". However when I run a query to get these results back I find that my text box only contains "this" for some reason it is ignoring everything after the space.

This is what I see in the app

App Text Box

This is what I see in the SharePoint List

What I see in SharePoint List

My code that I am using to retrieve items from the SharePoint list is:

 function getListItems() {
    web = appContextSite.get_web();
    mylist = web.get_lists().getByTitle('Expenses');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'ParentID\' /><Value Type=\'Text\'>' + queryparameter1 + '</Value></Eq></Where></Query></View>');
    var collListItem = mylist.getItems(camlQuery);
     Function.createDelegate(this, ListItemssuccessHandler),
     Function.createDelegate(this, ListItemserrorHandler)

    function ListItemssuccessHandler() {

        var listInfo = '';
        var listItemEnumerator = collListItem.getEnumerator();

        listInfo += "<table class='table table-hover table-condensed' id='MyTbl'><thead><tr>"
            + "<th>Details</th>"
            + "<th>Code</th>"
            + "<th>Number</th>"

        while (listItemEnumerator.moveNext()) {
            var oListItem = listItemEnumerator.get_current();

            listInfo += '<td><input type="text" id="detailsInput" name="Details" value=' + oListItem.get_item('Title') + ' size="35" required="required" /></td>'
            + '<td><select id=\'CodeDropdown\'><option value=' + oListItem.get_item('Code') + '>' + oListItem.get_item('Code') + '</select></td>'
            + '<td><input type="number" name="Amount" id="Amount" value=' + oListItem.get_item('Amount') + ' min="0.00" max="9999" step="0.01" size="4" required="required" /></td></tr>';


        listInfo += '</tbody></table>';

Is there something I am doing wrong when pulling back the data? How do I go about pulling back the full string of text please?

  • if you debug, what is the value of oListItem.get_item('Title')?
    – Gwny
    Sep 8, 2015 at 10:26

1 Answer 1


You are missing quotes "" around the value of textbox.


'<td><input type="text" id="detailsInput" name="Details" value="' + oListItem.get_item('Title') + '" size="35" required="required" /></td>'

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.