I don't really understand if your problem is in velocity or pure javascript ? Anyway, in pure javascript you would just have to escape the single and double quotes, something like the following (I did not test it, just found it by googling) : var escapedString = inputValue.replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); BR, Jeremie 2012/6/11 <[email protected]>:
Hello everybody,
I've a simple problem. I've a text input where people can enter some text. After, I want to send that text as a param to a javascript function. However, when user types a quote (simple or double), there is a problem in my javascript syntax. I've tred to add backslash but no effect.
Thanks for your help.
Mathieu Canzerini.
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users