123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <extend name="Public:base" />
- <block name="content">
- <div class="page-header">
- <h1>
- {$breadcrumb2}
- <small>
- <i class="icon-double-angle-right"></i>
- {$crumbs}
- </small>
- </h1>
- </div>
- <div class="row">
- <div class="col-xs-12">
- <form class="form-horizontal" id="validation-form" method="post" action='{$action}'>
-
- <notempty name="Think.get.id">
- <input name="weight_class_id" type="hidden" value="{$Think.get.id}" />
- </notempty>
-
-
- <div class="form-group">
- <label class="col-sm-1 control-label no-padding-left"> * 重量名称 </label>
- <div class="col-sm-11">
- <div class="clearfix">
- <input name="title" id="title" class="col-xs-10 col-sm-5" value="{$d.title|default=''}" type="text">
- </div>
- </div>
- </div>
- <div class="space-4"></div>
-
- <div class="form-group">
- <label class="col-sm-1 control-label no-padding-left"> *单位 </label>
- <div class="col-sm-11">
- <div class="clearfix">
- <input name="unit" id="unit" class="col-xs-10 col-sm-5" value="{$d.unit|default=''}" type="text">
- </div>
- </div>
- </div>
- <div class="space-4"></div>
-
-
- <div class="form-group">
- <label class="col-sm-1 control-label no-padding-left"> *值 </label>
- <div class="col-sm-11">
- <div class="clearfix">
- <input name="value" id="value" class="col-xs-10 col-sm-5" value="{$d.value|default=''}" type="text">
- </div>
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-sm-1 control-label no-padding-left"> </label>
- <div class="col-sm-11">
- <input name="send" type="submit" value="提交" class="btn btn-primary" />
- </div>
- </div>
- </form>
- </div>
- </div>
- </block>
- <block name="javascript">
- <script src="__JS__/jquery.validate.min.js"></script>
- <script>
- $(function(){
-
- $('#validation-form').validate({
- errorElement: 'div',
- errorClass: 'help-block',
- focusInvalid: false,
- rules: {
- title: {
- required: true,
- minlength: 1
- },
- unit: {
- required: true
- },
- value: {
- required: true
- }
-
- },
-
- messages: {
-
- title: {
- required: "必填",
- minlength: "不得少于1个字"
- },
- unit: {
- required: "必填"
- },
- value: {
- required: "必填"
- },
-
- },
-
- invalidHandler: function (event, validator) { //display error alert on form submit
- $('.alert-danger', $('.login-form')).show();
- },
-
- highlight: function (e) {
- $(e).closest('.form-group').removeClass('has-info').addClass('has-error');
- },
-
- success: function (e) {
- $(e).closest('.form-group').removeClass('has-error').addClass('has-info');
- $(e).remove();
- },
-
- errorPlacement: function (error, element) {
- error.insertAfter(element.parent());
- },
- });
-
- });
- </script>
- </block>
|