suxxoi,
$(function() {
var phone = $("#phone")[0];
$("#country_code").change(function() {
var id_country = this.value;
$.ajax({
type: "POST",
url: "/ajax/country.php",
data: "id=" + id_country,
dataType: "json",
success: function(data) {
var current = phone.value.replace(/.*(\d{9})$/, data.num+"$1");
phone.value = current
}
})
})
});