【发布时间】:2013-11-11 12:00:22
【问题描述】:
我有一个html文件,格式如下
<html>
<head>
<title>Create a product</title>
</head>
<body>
<form action="/submit/form/" method="POST">
<input name="text" placeholder="Email please"/>
<input name="" type="submit" class="btn btn-large big_btn " value="Save Changes">
<input id="cancel_profile_changes" name="" type="button" class="btn btn-large big_blkbtn hide_margtp_35_a " value="Cancel">
</form>
<body>
</html>
当用户提交表单时,它会重定向到action attribute url,但是当用户点击取消时,一个弹出对话框应该会打开一条消息Are u sure u want to discard changes 和ok 和cancel。
所以当用户点击Ok时,他应该被重定向到一个url/dashboard/,
如果他点击cancel,那么他应该在同一个页面中而不重定向并且不会丢失表单数据
那么如何用twitter bootstrap很容易地实现上述功能,
到目前为止,我一直在使用 bootbox.js 来实现这种功能,但是由于设计实现我只想使用 twitter bootstrap 吗?
那么如何使用 twitter bootstrap 实现上述功能?
【问题讨论】:
标签: jquery twitter-bootstrap popup modal-dialog confirm