You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.5 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. @extends('admin.layouts.app')
  2. @section('title', '参数修改')
  3. @section('content')
  4. <h5 class="sub-header"><a href="/fladmin/sysconfig">系统配置参数</a> > 参数修改</h5>
  5. <form id="addarc" method="post" action="/fladmin/sysconfig/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
  6. <table class="table table-striped table-bordered">
  7. <tbody>
  8. <tr>
  9. <td align="right">参数名称:</td>
  10. <td><input name="varname" type="text" id="varname" value="<?php echo $post["varname"]; ?>" class="required" style="width:30%" placeholder="在此输入参数变量">(必须是字母)<input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
  11. </tr>
  12. <tr>
  13. <td align="right">参数说明:</td>
  14. <td><input name="info" type="text" id="info" value="<?php echo $post["info"]; ?>" style="width:60%"></td>
  15. </tr>
  16. <tr>
  17. <td align="right">参数值:</td>
  18. <td><textarea name="value" rows="5" id="value" style="width:80%;height:70px;vertical-align:middle;"><?php echo $post["value"]; ?></textarea></td>
  19. </tr>
  20. <tr>
  21. <td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
  22. </tr>
  23. </tbody></table></form><!-- 表单结束 -->
  24. <script>
  25. $(function(){
  26. var bempty = true;
  27. $("#varname").blur(function(){
  28. var reg = /^cms_[a-z]+$/i; // 创建正则表达式模式
  29. var str = this.value;
  30. if(!str.match(reg)){bempty=false;alert('输入错误,请重新输入!');}else{bempty=true}
  31. });
  32. $(".required").blur(function(){
  33. var $parent = $(this).parent();
  34. $parent.find(".formtips").remove();
  35. if(this.value=="")
  36. {
  37. $parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
  38. }
  39. else
  40. {
  41. if(bempty)
  42. {
  43. $parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
  44. }
  45. }
  46. });
  47. //重置
  48. $('#addarc input[type="reset"]').click(function(){
  49. $(".formtips").remove();
  50. });
  51. $("#addarc").submit(function(){
  52. $(".required").trigger('blur');
  53. var numError = $('#addarc .onError').length;
  54. if(numError){return false;}
  55. });
  56. });
  57. </script>
  58. @endsection