Hi guys, I have a form with multiline textbox it is submitted to database and everything works perfectly at this state.
The data are bind through gridview rowdatabound to be read back to javascript function. But the issue come with newline character.

Code:
  function get_jobpost(jdesc) {
          
           var njdesc = replaceAll(jdesc, "\n", "");
           njdesc = unescape(njdesc);
           
         
           document.getElementById('descTextBox').value = njdesc;
    
       }


function replaceAll(txt, replace, with_this) { return txt.replace(new RegExp(replace, 'g'), with_this); }
Code:
  if (e.Row.RowType == DataControlRowType.DataRow)
        {
            DataRowView rowView = e.Row.DataItem as DataRowView;

            ImageButton imgbtn = (ImageButton)(e.Row.FindControl("selectImageButton"));
            string jdesc =''" + Convert.ToString(rowView["details"]) + "'";      

             imgbtn.Attributes.Add("OnClick", "javascript: return get_jobpost(" + jdesc+ "); ");
        }
Appreciate any help.