We have a d/e form in which a Company Name is being captured.
Often a company name contains a ampersand within it:
eg: Ivan & Sons
This value is being passed to the Webserver for processing there using AJAX.
It appears that AJAX uses the & character to delimit the NAME:VALUE pairs being sent back to the Web Server (APACHE 2.X) for processing.
The problem encountered is that the VALUE being sent back to the web server is being truncated at the & character.
eg: txtCompanyName:"Ivan & Sons"
What is available in the POST array will be Ivan (only).
This is very puzzling. How is this overcome ??
var addrLine1 = "J&K Apts., 2nd Flr" ;
var addrLine2 = "S.V road";
var addrLine3 = "Mumbai" ;
var cityId = "1";
var pincode = "400001"
objAjaxCompInsertReq.params = 'action=insertCompanyData§ion=' + section + "&compId=" + compId +"&addrLine1=" + addrLine1 + "&addrLine2=" + addrLine2 + "&addrLine3=" + addrLine3 + "&cityId=" + cityId + "&pincode=" + pincode +'&SID=' + Math.random() ;
Notice the ampersand issue in addrLine1.
What is visible in the POST Array is just the alphabet J