Response title
This is preview!
Hello I have problem regarding jquery.
Well the problem is, the input text value stays the same everytime.
Instance: I click on the edit button and the customer details are populated using ajax. and then when I try to change for example the name of the customer, it submits the old value. it does not change.
Here's my code.
$(document).on('click','#editcustomer-btn-save',function(e) {
var params = {
id: $('#editcustomerform .customerid').val(),
name : $('#fuck').val(),
address : $('#edit-customer .address').val(),
city : $('#edit-customer .cityedit').val(),
type : $('#edit-customer .type').val(),
agent : $('#edit-customer .agent').val(),
tinno : $('#edit-customer .tinno').val(),
person : $('#edit-customer .person').val(),
phone1 : $('#edit-customer .phone1').val(),
phone2 : $('#edit-customer .phone2').val(),
notes : $('#edit-customer .notes').val()
}
alert(params.name);
$.post(BASE_URI+'admin/customer/editcustomer',params, function(data) {
if(data == "") {
window.location.reload();
} else {
alert(data);
e.preventDefault();
return false;
}
});
});
And one more thing, when I tried to use this in the params document.getElementById("fuck").value = 'test'
it does work. So I think jquery is the problem? Thanks!
© 2013 jQuery Foundation
Sponsored by and others.