js判定username的input正确就跳转到home.html

如下,想将下面修改成标题功能,username不能改...

求大神
jQuery(document).ready(function() {

$('.page-container form').submit(function(){
var username = $(this).find('.username').val();
if(username == '') {
$(this).find('.error').fadeOut('fast', function(){
$(this).css('top', '27px');
});
$(this).find('.error').fadeIn('fast', function(){
$(this).parent().find('.username').focus();
});
return false;
}

});

$('.page-container form .username').keyup(function(){
$(this).parent().find('.error').fadeOut('fast');
});

});

jQuery(document).ready(function() {

    $('.page-container form').submit(function() {
        var username = $(this).find('.username').val();
        if (username == '') {
            $(this).find('.error').fadeOut('fast', function() {
                $(this).css('top', '27px');
            });
            $(this).find('.error').fadeIn('fast', function() {
                $(this).parent().find('.username').focus();
            });
            return false;
        }

        if (username=="设定的值") {
            location.href="home.html";
            return;
        };

    });

    $('.page-container form .username').keyup(function() {
        $(this).parent().find('.error').fadeOut('fast');
    });

});追问

这个应该是对的,但是我自己修改了还是没用,能不能发给你帮我修改下啊?

温馨提示:答案为网友推荐,仅供参考
相似回答