如何用用户输入的电子邮件地址追加URL,然后通过按钮提交此电子邮件地址?我使用的模式将弹出,要求电子邮件,然后调用网址时,用户点击提交按钮。(支持jQuery)任何帮助都是非常感谢的!谢谢
<div id="emailModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel"> We Can Help</h3>
</div>
<div class="modal-body">
<h6> Enter your information in the fields below to reset a forgotten password, or to restore access to an account that has been locked for security </h6>
<br>
<form >
<input type="text" class="input-block-level" placeholder="Email address">
<!-- <input type="password" class="input-block-level" placeholder="Password">
<label class="checkbox">
<a href="#"><input type="checkbox" value="remember-me"> Remember me
</label></a> -->
</form>
</div>
<div class="modal-footer">
<button class="m-btn blue" data-dismiss="modal">Submit</button>
</div>
</div>发布于 2013-10-02 19:26:53
把表格改成这个..。
<form action="some-url.php" method="get">
<input type="text" name="email" class="input-block-level" placeholder="Email address">
</form>加上这个剧本..。
$("#emailModal button").on("click", function() {
$("#emailModal form").submit();
});发布于 2013-10-02 18:46:49
你可以做这样的事
$("#emailModal .m-btn").click(function(){
$.post("/my/url?email=" + $("#emailModal input.input-block-level").val(), function(){
// this function is called on POST finish.
});
return false;
});我想这就是你想要的。
https://stackoverflow.com/questions/19144373
复制相似问题