PHP + jQuery - undefined index: , but it still posts successfully?
- by Ben Bernards
When inserting a record to a database, the server returns an 'undefined index: category', error, but still posts the successfully...
$('#button).click(function(){
var newvendor = $('#input_vendor).val();
newplantcode = $('#input_plantcode).val();
newcategory = $('#input_category).val();
$.post("php/addSite.php",
{vendor: newvendor,
plant_code: newplantcode,
category: newcategory}, // <--- Error on this line, for some reason...
function(result){
console.log("server returned : " + result);
[ RELOAD THE PAGE ]
}