I want to edit data by using modal with editable data.
$HTML='<script> var js_array = '.JSON_encode($result).';
</script>';
echo $HTML;
and in javascript
var id=supplier_id;
$.ajax({
url:"index.php/Supplier/edit",
type:"POST",
data:{ID:id},
dataType: 'json',
cache: false,
success: function(result) {
.............??????????????..................
alert(js_array['SupplierCode']);
},
});
}
Now I have JSON object but i tried to access the objects individually but it is not working.
I have my data in the following format:
var js_array = {"SupplierCode":"52","SupplierName":"GANE","Address":"79\/9 UR ST","City":"TANJORE","State":"TN","Country":"IN","PinCode":"624531","ContactPerson":"GANI","MobileNumber":"8807892105","TelephoneNumber":null,"EmailID":"gani@fun.in","FaxNumber":null,"Website":"www.gani.in"};