cant store returned values from ajaxJSON function
Posted: Fri Feb 15, 2013 6:41 pm
Hi this is my ajaxJSON function:
This if my infoHandler function:
I'm trying to assign a text field with id "sigSaveId" with the value "Y" or "N"
The ajax request is successful. it sends back obj.data with "success". But when i try to assign obj.data or any variable within the infoHandler function, nothing gets assigned.
Help please.
Code: Select all
ajaxJSON({
url: "/php/sig_image_store.php",
params: {
sig: bmpString,
name: imageName
},
method: "post",
async: true,
handler: infoHandler
});
Code: Select all
function infoHandler(obj) {
alert("Result: " + obj.data);
if(obj.data != 'success'){
changeElementValue("sigSaveId",'N');
}else{
changeElementValue("sigSaveId",'Y');
}
alert(get('sigSaveId'));
}
The ajax request is successful. it sends back obj.data with "success". But when i try to assign obj.data or any variable within the infoHandler function, nothing gets assigned.
Help please.