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>';
     }
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>';
}
  • 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.