Jquery PostBody Won't Submit Var With "&" Included
Posted: Tue Sep 29, 2009 3:29 pm
What is the best way to remedy this? The exact code that I use to post to a PHP/Mysql script, in the background, is below.
It works perfectly so long as ''&' is not included in the form submission. Should I just declare this var as a qstring and then sanitize it? I am new to this so forgive me if this seems obvious.
For Reference, if I add a value to the form (where I am adding categories to a db) "Test & Test" it will only show 'Test" while omitting the '& Test'. Just fyi.
It works perfectly so long as ''&' is not included in the form submission. Should I just declare this var as a qstring and then sanitize it? I am new to this so forgive me if this seems obvious.
For Reference, if I add a value to the form (where I am adding categories to a db) "Test & Test" it will only show 'Test" while omitting the '& Test'. Just fyi.
Code: Select all
function sendRequest() {
new Ajax.Request("page_I_submit_to.php",
{
method: 'post',
postBody: '[b]category='+ $F('category'[/b]),
onComplete: showResponse
});
}
function showResponse(req){
$('show').innerHTML= req.responseText;
}