//校验电话号码
var phone_part1 = $("input[name='phone_part_1']").val();
var phone_part2 = $("input[name='phone_part_2']").val();
var phone_part3 = $("input[name='phone_part_3']").val();
var phone_full = phone_part1 + phone_part2 + phone_part3;
var ca_area_code = new Array(
    '403', '780', '250', '604', '778', 
    '306', '867', '204', '506', '709', 
    '902', '289', '416', '519', '613', 
    '647', '705', '807', '905', '418', 
    '450', '514', '819', '226'
);

if( ! phone_full.match(/[0-9]{10}/) ) {
    alert("电话号码应该有10位数字组成,请检查!");
    return false;
}

if( jQuery.inArray(phone_part1, ca_area_code) < 0 ) {
    alert("电话号码的区号不正确,请检查!");
    return false;
}

//电话号码的第二段的首位不应该是“1”
if( phone_part2.substr(0, 1) == '1' ) {
    alert("电话号码的格式不正确,请检查!");
    return false;
}

/**
 * 规范用户输入的电话号码
 *
 */
$('.phone').bind('keyup', function() {
    var curr_val = $(this).val();
    var curr_len = curr_val.length;
    var last_char = curr_val.substr(curr_len - 1, 1);
    var new_val = '';
    
    if( ! last_char.match(/[0-9]/) ) {
        new_val = curr_val.substr(0, curr_len - 1);
        $(this).val(new_val);
    }
    
    //输入完固定的段位后,自动跳转到下一个段位
    var part_1_len = $("input[name='phone_part_1']").val().length;
    var part_2_len = $("input[name='phone_part_2']").val().length;
    var part_3_len = $("input[name='phone_part_3']").val().length;
    
    if( part_1_len == 3 && part_2_len == 0 && part_3_len == 0 ) {
        $("input[name='phone_part_2']").focus();
    }
    if( part_1_len == 3 && part_2_len == 3 && part_3_len == 0 ) {
        $("input[name='phone_part_3']").focus();
    }
});

/* HTML Party
--------------------------------------------------------------------------*/
<label>联系电话</label>
<input type='text' name='phone_part_1' value='' maxlength='3' class='phone' /> -
<input type='text' name='phone_part_2' value='' maxlength='3' class='phone' /> -
<input class="p3 phone" type='text' name='phone_part_3' value='' maxlength='4' class='phone' />