how to convert String in the form tag(at once)?

Viewed 40

problem

when enter special characters on a web page, There's no problem with being stored in a database

But There is an error when i call it back to json and put it in the array.

syntaxError : missing ) after argument list

Question

If there are special characters( ", ', ) in the input tag, I want to modify them all at once.(not hard coding)

[convert "content" to "content" ]

  1. How to modify it on the server(java)
  2. or in the page(use javascript).
<input name="val1...
<input name="val2...
..
<input name="val9..
</form>


<script>
**list.push("${list.title}");**      <<   
content.push("${list.content}"
</script>

I can convert this at the java - controller to use replace method but it's inefficient because it's hard coding


else if(listVO.getman().contains("\"")){   
            String cng =  plant_list.getman();
            //cng = cng.replace("\"", "\\\"");&quot;
            cng = cng.replace("\"", "&quot;");
            listVO.setman(cng);
        }

0 Answers
Related