edit.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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="stock_status_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="name" id="name" class="col-xs-10 col-sm-5" value="{$d.name|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-1 control-label no-padding-left"> </label>
  29. <div class="col-sm-11">
  30. <input name="send" type="submit" value="提交" class="btn btn-primary" />
  31. </div>
  32. </div>
  33. </form>
  34. </div>
  35. </div>
  36. </block>
  37. <block name="javascript">
  38. <script src="__JS__/jquery.validate.min.js"></script>
  39. <script>
  40. $(function(){
  41. $('#validation-form').validate({
  42. errorElement: 'div',
  43. errorClass: 'help-block',
  44. focusInvalid: false,
  45. rules: {
  46. name: {
  47. required: true,
  48. minlength: 2
  49. }
  50. },
  51. messages: {
  52. name: {
  53. required: "必填",
  54. minlength: "不得少于2个字"
  55. }
  56. },
  57. invalidHandler: function (event, validator) { //display error alert on form submit
  58. $('.alert-danger', $('.login-form')).show();
  59. },
  60. highlight: function (e) {
  61. $(e).closest('.form-group').removeClass('has-info').addClass('has-error');
  62. },
  63. success: function (e) {
  64. $(e).closest('.form-group').removeClass('has-error').addClass('has-info');
  65. $(e).remove();
  66. },
  67. errorPlacement: function (error, element) {
  68. error.insertAfter(element.parent());
  69. },
  70. });
  71. });
  72. </script>
  73. </block>