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;
}