Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

javascript client object model - removing unwanted div characters from multiline textbox field

$
0
0

Hi,

I have a multi-line text field. I am trying to retrieve the values from the multiline rich text field using the javascript client object model.

My current code is:

 var context = new SP.ClientContext.get_current();

    var web = context.get_web();
     var oList = web.get_lists().getByTitle(itgConfigTitle);
    var camlQuery = new SP.CamlQuery();

    var q = 'caml query';
    camlQuery.set_viewXml(q);

    this.collListItem = oList.getItems(camlQuery);

  var itemFieldValues = collListItem.FieldValuesAsText;

  context.load(itemFieldValues, 'Include(Title,TestValue,TestDetails)');

//TestDetails is a multiline field

    context.executeQueryAsync(Function.createDelegate(this, this.Configsuccess), Function.createDelegate(this, this.failed));

function Configsuccess(sender, args) {

    var enumerator = this.itemFieldValues.getEnumerator();

    while (enumerator.moveNext()) {
        var currentItem = enumerator.get_current();
}
}

I have used the "FieldValuesAsText", but is this the correct way.

How to avoid the div tags and get the data alone from multiline field in javascript client object model?

Thanks




Viewing all articles
Browse latest Browse all 7589

Trending Articles



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