I am submitting a form using .ajax()
.
The current script contains:
data: dataString,
dataString
contains:
var list = $('.listsummary').val()
The class listsummary
belongs to a textarea
which users fill in,
or will be (partially) filled in dynamically through a different script.
The problem is that users nearly all of the time use the '&' sign, for example:
Potato & Patota blah blah blah
This screws up the dataString
allowing to post everything written before the first '&' is found.
How can I achieve that the var list
will be properly sent to the PHP handler in order to store the entire textarea
content into the database WITH the use of '&'?