I want to send data to a function after the default value of an input field is changed.
function change_pos(position, new_pos) {
$.post(iloc, {a:"change_pos", position:position, new_pos:new_pos}, function(d){
window.location = "[@HTTP_ADDR]/cms/gallery";
});
}
<input type=\"text\" value=\"{$row['POSITION']}\" onchange=\"change_pos('{$row['POSITION']}', this)\" />
The idea is to send the current and “new” positions. But the function doesn’t accept them.
Note: PHP is fine! jQuery is the problem!
Replace
thisinonchangeevent withthis.value