[英]Redirect on Google after Successfully Submit Form
我創建了一個包含姓名、電子郵件、電話字段的表單。
<div class="col-md-4 col-md-offset-4 my">
<form role="form">
<div class="form-group">
<label for="contact_name">Name</label>
<input class="form-control" id="contact_name" name="contact_name" required="true" type="text"/>
</div>
<div class="form-group">
<label for="email_from">Email address</label>
<input class="form-control" id="email_from" name="email_from" type="email"/>
</div>
<div class="form-group">
<label for="phone">Phone No</label>
<input class="form-control" id="pnone" name="phone" type="text"/>
</div>
<button class="btn btn-primary center-block" style="width: 35%;" type="submit">Submit</button>
</form>
</div
我想要行動和提交事件。 操作用於提交我的表單並在成功提交后提交重定向。 成功提交后,我想重定向到谷歌。
....
document.formNameGoesHere.submit();
window.location = "http://www.google.com";
});
嘗試這個
$(document).ready(function(){
$(".btn").click(function(){
$(this).closest('form').submit();
window.location="www.google.com";
})
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.