Good Day All
in my page i have a hyperlink button in a gridview defined like this
and the Function showComment is defined like thisCode:<a href="#" onclick="<%# String.Format("return showComment('{0}','{1}')", Replace(Eval("Field1").ToString(),Chr(13),"<BR>"), Replace(Eval("Field2").ToString(),Chr(13),"<BR>") ) %>"> <img src="../../Imgs/comment2.png" /> </a>
now as you can see i am trying to get rid of the special characters like the carriage returns but still i get a a javascript error when this link is clickedCode:function showComment(CommentPend,CommentCancel) { $("#btnclose").unbind(); $("#divPendComment").center(); $("#divPendComment").fadeIn('slow'); $("#txtcomment").val(CommentPend.toString().replace(/^[a-z0-9 ]$/i, '')); $("#txtcommentCancel").val(CommentCancel.toString().replace(/^[a-z0-9 ]$/i, '')); $("#btnclose").click(function (e) { $("#divPendComment").fadeOut('slow'); e.preventDefault(); }); return false; }
Uncaught SyntaxError: Unexpected token ILLEGAL
thanks


Reply With Quote
