$('#new_city').submit(function(){ var rel = $(this).attr('data-rel'); var country_id = $(this).val();