Table loaded by javascript passing tags

Asked

Viewed 36 times

-1

I have a table which is loaded via ajax, in this way:

 $.each(data.listaNSerie, function (i, item) {
                $("#tableNSerie").append("<tr>"
                    + "<td>" + item.produto.codigo + "</td>"
                    + "<td>" + item.produto.nome + "</td>"
                    + "<td type='text' class='form-control'>" + "</td>"
                    + "</tr>");
            });

It works, and I get the data via controller, but when the user presses enter, because in the third column it is digitable, and is passed to the controller, he receives so: 265656/2<div>26626262626 /&nbsp; 26262626</div>, and he should receive so: 265656/226626262626/26262626, how to solve ??

1 answer

0


I was able to solve, apart from the html part, with the method below:

 public static string StripHTML(string input)
    {
        return Regex.Replace(input, "<.*?>", String.Empty);
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.