mercredi 25 mars 2015

HTML form submitting values with multiple double quotes

HTML Code:



<form action="...">
<textarea name="str">"abc"</textarea>
</form>


JS Code:



console.log($("textarea").val()); //output "abc" -> correct


Server side is written in java. Found that it receives value of textarea as ""abc"".


When textarea is again populated with the saved value. i.e. upon refresh and some ajax implementation. It shows values as ""abc"". This seems to be a general and frequent scenario to me. But could not find any solution.


Aucun commentaire:

Enregistrer un commentaire