从用户获取值的表单,OnSubmit 调用函数 check_three_func()
<form method="post" action="register_action.php" id="register_form" name="register_form"
onsubmit="return check_three_func()">
<br>
<div class="form-group">
<label for="uname">Name:</label>
<input type="text" class="form-control" id="uname" placeholder="Enter Name " name="uname">
</div>
<div class="form-group">
<label for="uemail">Email id: </label>
<input type="email" class="form-control" id="uemail" placeholder="Enter Email ID" name="uemail">
<!-- onkeyup="javascript:validate(this.value)" -->
<span id="alert" style="display:none"></span>
</div>
<div class="form-group">
<label for="upassword">Enter Password:</label>
<input type="password" class="form-control" id="upassword" placeholder="Set password" name="upassword">
</div>
<div class="form-group">
<label for="ucpassword">Confirm Password:</label>
<input type="password" class="form-control" id="ucpassword" placeholder="Enter password again" name="ucpassword" >
</div>
<!-- captcha div -->
<div class="form-group">
<img src="captcha.php" class="rounded" alt="Captcha"><br>
<label for="captcha">Enter Captcha: </label>
<input type="text" class="form-control" id="captcha" name="captcha" maxlength="6">
<!-- onkeyup="javascript:captcha_func(this.value)" -->
<span id="captcha-result" style="display:none"></span>
</div>
<button type="submit" class="btn btn-success" id="submit-button" >Submit</button>
</form>
check_three_func() 在代码中调用下面提到的 3 个函数并返回 return_type,因此如果为 false 则无法提交表单
function check_three_func(){
var check_email_func=check_email();
var click_to_func=click_to();
var check_func=check();
if( check_email_func==true && click_to_func==true && check_func==true){
return true;
console.log("all true");
}
else{
return false;
console.log(" false");
}
}
饮歌长啸
宝慕林4294392