0

I am binding the data for SharePoint list item as below . But after binding the data I am getting the result in double quotations.

Can any one please help me in finding the issue in below lines

var txtparticipateidvalue="txtparticipants"+count;
var tempparticipantsvalues=oListItem.get_item('TTParticipants');
var wraper;
   if(tempparticipantsvalues!=null)
    {
    var wraper= '<textarea   id="'+txtparticipateidvalue+'"  disabled  rows="1" 
     cols="30" wrap="Hard">"'+tempparticipantsvalues+'" </textarea>';
          $(document).on("keyup", "textarea", check);
    }
    else
    {
     var wraper= '<textarea   id="'+txtparticipateidvalue+'"  disabled  rows="1" cols="30" wrap="Hard"> </textarea>';
     }
Ax Learner
  • 31
  • 3

2 Answers2

0

Remove the double quotes from your strings:

var txtparticipateidvalue="txtparticipants"+count;
var tempparticipantsvalues=oListItem.get_item('TTParticipants');
var wraper;
if(tempparticipantsvalues!=null)
{
    var wraper= '<textarea   id="'+txtparticipateidvalue+'"  disabled  rows="1" cols="30" wrap="Hard">'+tempparticipantsvalues+'</textarea>';
    $(document).on("keyup", "textarea", check);
}
else
{
    var wraper= '<textarea   id="'+txtparticipateidvalue+'"  disabled  rows="1" cols="30" wrap="Hard"> </textarea>';
}
theChrisKent
  • 6,001
  • 21
  • 34
  • Could you please do let me know for which string I need to remove – MSA Apr 16 '18 at 16:20
  • You have the double quotes inside your string the first time you set the wraper variable. So wrap="Hard">"' should just be wrap="Hard">' and the same with the other side of the tempparticipantsvalues – theChrisKent Apr 16 '18 at 18:37
0

You can try this:

var tempparticipantsvalues=oListItem.get_item('TTParticipants');
tempparticipantsvalues = tempparticipantsvalues.replace(/"/g, '');

That should remove the "" from your string.

lazoDev
  • 1,806
  • 14
  • 20