confirm-form
选择与操作 用来在选项中做选择的控件,以及收尾一个表单的行。每一个都放在带内边距的 rst-box 里,因为表单就放在这样的卡片里。
确认页的操作行。破坏性操作有自己的路由而不是一个对话框,所以没有什么需要写脚本。
每个示例都能真实操作,但其中的链接不会跳转到任何地方。 HTML 显示可复制的标记。
破坏性操作
把这段放进 <section rst-box> 里。
<form rst-form-actions method ="post" action ="/posts/1/delete" >
<input type ="hidden" name ="csrf" value ="tok-123" >
<input type ="hidden" name ="id" value ="1" >
<a rst-btn ="ghost lg" href ="/posts/1" >取消</a >
<button type ="submit" rst-btn ="danger lg" >删除这篇文章</button >
</form >
在应用里,这会到达 /posts/1, /posts/1/delete。在这里,它的链接和表单哪儿也不去。
普通情况,取消用默认措辞
取消链接写的是「取消」,这是通常的措辞。当表单自己的说法更清楚时,就改掉它。
把这段放进 <section rst-box> 里。
<form rst-form-actions method ="post" action ="/posts/1/publish" >
<a rst-btn ="ghost lg" href ="/posts/1" >取消</a >
<button type ="submit" rst-btn ="primary lg" >发布</button >
</form >
在应用里,这会到达 /posts/1, /posts/1/publish。在这里,它的链接和表单哪儿也不去。