It would be better to separate your javascript from the element on the page and avoid the onClick HTML link. Use this ...
jQuery('.rtodata select').bind('change', function (e) {
jQuery.ajax({
type: 'post',
url: 'ajax-file.php',
data: {
value: jQuery('select option:selected', jQuery(e.currentTarget).parent()).val()
},
success: function (r) {
alert('success');
},
error: function (error, t, msg) {
alert('failed');
}
});
}
ajax-file.php $_POST. - HTML , onClick="....", HTML, .