I have a Text box and am just checking the availability of the text using jqueryAjax. Am facing a Issue like when am checking for a text containing &
the Post Variables in the jquery I checked for the solution which was given in the Stack overflow Thread but still in that when we take the html encoded value for &
it gives &
which will again have &
and as a result the jquery ajax post variable gets broken. the code i tried is given below
//from the text field
var textfieldValue=$('#text').val();
//Jquery Ajax
$.ajax({
type: "POST",
async: false,
url: "ajax/CheckAvailabilityphppage.php",
data: "fieldvalue="+textfieldValue,
dataType: "json",
success: function(data){
if (data['Status'] == 'YES'){
alert('yes its Available');
}else{
alert('Sorry Not Available');
}
}
});
In the Firebug the Post Variables are shown as (if the text is P&P)
P
fieldvalue P
The &P
is taking as an another Post Parameter and as a result the ajax is only validating the text P
Any Help or suggestions are much Appreciated.
Thanks a Lot