没有重定向我形成行动

时间:2013-12-24 05:34:21

标签: javascript php ajax

   <div class="bottom"> 
                <font class="ftxt">
                    <a href="javascript: void(0);" onclick="sin();" class="stxtcolor">&nbsp;&nbsp;&nbsp;Sign in</a> or</font>
                    <a href="myaccount.php" class="regbg" />Register Now</a>
        </div>

当用户点击SIN(); 此POP-UP GENERATES

function sin() {
                var lbox = new LadduBox();
                lbox.init({
                        "width": 500,
                        "height": 300,
                        "HTML": '<div style="width:495px; height:231px; background-color:#ffffff; border:2px solid #ffdcc3;border-radius: 7px; "><table cellspacing="0" cellpadding="0" border="0" align="center" width="489" height="235" style="font-family:arial; font-size:20px; "><div><tr><td align="right" valign="top" colspan="3"><img src="'+img_loc+'c0.png" style="margin:5px; cursor:pointer;" id="btnClose"/></td></tr></div><tr><td height="50" colspan="3" align="left"><div style="margin-top: -77px;"><div style="font-family:arial; font-size:20px; color:#ff6c00;padding-left: 29px;font-weight:bold;">SIGN IN</div><div style="font-family:arial; font-size:12px; color:#747474;padding-left: 29px;">Hello there , Welcome back!</div></div></td></tr><tr><td width="230" style="padding-left:20px;"><form action="sbs.php" method="POST" onsubmit="return chk();"><div style="margin-top: -83px;"><div style="margin:10px; margin-top:18px; color:#5d5d5d; font-size:14px;font-weight:bold;">Email<br><input type="text" name="email" id="demail" /></div><br><div style="margin-left:10px; margin-top:-18px; color:#5d5d5d; font-size:14px;font-weight:bold;">Password<br><input type="password" name="paswrd" id="dpass"/><br><div class="err" id="er99"></div></div><br><div style="margin-top: -8px;"><input type="submit" value="Submit" class="subbg1"/><a href="" class="forget" >Forget password?</div></div></form></td><td align="center"><div style="margin-top:-83px; margin-left: -14px;"><img src="'+img_loc+'orbar.png" /></div></td><td align="center"><div style="margin-top:-76px;"><div style="margin-left:50px;"><a href=sign_in.php?val=1" class="imgreg_sign" style="margin-bottom:7px;"/></a></div><br><div style="margin-left:40px;"><a href=sign_in.php?val=2" class="g-h_sign" style="margin-bottom:7px;"/></a></div><br><div style="margin-left:40px;"><a href=sign_in.php?val=3" class="t-h_sign" /></a></div></div></td></tr></table></div>',
                        'btnCloseId': '#btnClose'
                });
                lbox.fire();
        }

何时用户填写电子邮件和密码字段并单击“提交”按钮。这个过程运行

function chk() {
    var ret = false;
    var demail = $("#demail").val();
    var dpass = $("#dpass").val();
    //console.log(demail+dpass);
    //console.log(ret);
    $.post("sbs_main.php",{
    "demail": demail,
    "dpass": dpass
    }, function (data) {
        if (data.result == "0") {
           ret = false;
           $("#er99").html('<img src="'+img_loc+'cross.png"/> Wrong Email Id or Password');
        }
        if (data.result == "-1") {
           ret = false;
           $("#er99").html('<img src="'+img_loc+'cross.png"/> Cannot be left blank');
        }
        if (data.result == "1") {
           ret = true;

        }
                            });


    return ret;
}

当返回为true时,它不会将我重定向到表单操作,即sbs.php。我想知道我哪里出错了。

1 个答案:

答案 0 :(得分:0)

以您想要的格式添加action="sbs.php"