I am an bit lost on the following thing.
I have this piece of code,
Fleet.php
function sendData(nr) {
var data = $("#myform" + nr).serialize();
console.log(data);
$("#myForm" + nr).submit(function(event){
event.preventDefault();
});
jQuery.ajax({
url: "inc/FleetData.php",
datatype: "html",
type: "POST",
data: data,
success:function(data)
{
if(data) {
//$("#fleet").load(window.location + " #fleet");
$('#fleet').html(data);
//alert(data);
} else {
//$("#fleet").load(window.location + " #container");
//alert("Something is wrong with the update of the collor. Please notify an admin");
//alert(data);
}
}
});
}
the form
Now for the first time I change the value it will post the values to fleetData.php,
then it will load the div.
After that I can change the value but it will not send the data to fleetData.php,
this is only happening with textfields and not with select fields.
Edit:
Select Fields
Red
Blue
Green
Purple
Yellow