edit.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="page-header">
  4. <h1>
  5. {$breadcrumb2}
  6. <small>
  7. <i class="icon-double-angle-right"></i>
  8. {$crumbs}
  9. </small>
  10. </h1>
  11. </div>
  12. <div class="row">
  13. <div class="col-xs-12">
  14. <form class="form-horizontal" id="validation-form" method="post" action='{$action}'>
  15. <notempty name="Think.get.id">
  16. <input name="bad_id" type="hidden" value="{$Think.get.id}" />
  17. </notempty>
  18. <div class="form-group">
  19. <label class="col-sm-2 control-label no-padding-left"> * 违禁词 </label>
  20. <div class="col-sm-10">
  21. <div class="clearfix">
  22. <input name="badword" id="badword" class="col-xs-10 col-sm-5" value="{$d.badword|default=''}" type="text">
  23. </div>
  24. </div>
  25. </div>
  26. <div class="space-4"></div>
  27. <div class="form-group">
  28. <label class="col-sm-2 control-label no-padding-left"> 替换为 </label>
  29. <div class="col-sm-10">
  30. <input name="replaceword" class="col-xs-10 col-sm-5" value="{$d.replaceword|default=''}" type="text">
  31. </div>
  32. </div>
  33. <div class="space-4"></div>
  34. <div class="form-group">
  35. <label class="col-sm-1 control-label no-padding-left"> </label>
  36. <div class="col-sm-11">
  37. <input name="send" type="submit" value="提交" class="btn btn-primary" />
  38. </div>
  39. </div>
  40. </form>
  41. </div>
  42. </div>
  43. </block>
  44. <block name="javascript">
  45. <script src="__JS__/jquery.validate.min.js"></script>
  46. <script>
  47. $(function(){
  48. $('#validation-form').validate({
  49. errorElement: 'div',
  50. errorClass: 'help-block',
  51. focusInvalid: false,
  52. rules: {
  53. badword: {
  54. required: true,
  55. minlength: 1
  56. }
  57. },
  58. messages: {
  59. badword: {
  60. required: "必填",
  61. minlength: "不得少于2个字"
  62. }
  63. },
  64. invalidHandler: function (event, validator) { //display error alert on form submit
  65. $('.alert-danger', $('.login-form')).show();
  66. },
  67. highlight: function (e) {
  68. $(e).closest('.form-group').removeClass('has-info').addClass('has-error');
  69. },
  70. success: function (e) {
  71. $(e).closest('.form-group').removeClass('has-error').addClass('has-info');
  72. $(e).remove();
  73. },
  74. errorPlacement: function (error, element) {
  75. error.insertAfter(element.parent());
  76. },
  77. });
  78. });
  79. </script>
  80. </block>