Bez popisu
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.

field_add.htm 3.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {include file="public/layout" /}
  2. <body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;min-width: auto;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page" style="min-width: auto;box-shadow:none;padding-bottom: 0px;">
  6. <form class="form-horizontal" id="post_form" action="{:url('Form/field_add')}" method="post" onsubmit="return false;">
  7. <div class="ncap-form-default">
  8. <dl class="row">
  9. <dt class="tit">
  10. <label for="form_name"><em>*</em>表单名称</label>
  11. </dt>
  12. <dd class="opt" style="width: auto;">
  13. <input type="text" name="form_name" id="form_name" class="w200" autocomplete="off">
  14. <span class="err"></span>
  15. <p class="notic"></p>
  16. </dd>
  17. </dl>
  18. <dl class="row">
  19. <dt class="tit">
  20. <label>前台表单字段</label>
  21. </dt>
  22. <dd class="opt" style="width: auto;">
  23. <label class="curpoin"><input type="radio" name="attr_auto" value="1" checked="checked"/>自动</label>&nbsp;&nbsp;
  24. <label class="curpoin"><input type="radio" name="attr_auto" value="0"/>手动</label>&nbsp;&nbsp;
  25. <p class="notic">前台表单字段会随着后台新增字段是否自动显示</p>
  26. </dd>
  27. </dl>
  28. <div class="bot">
  29. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  30. </div>
  31. </div>
  32. </form>
  33. </div>
  34. <script type="text/javascript">
  35. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  36. $(function(){
  37. $('input[name=form_name]').focus();
  38. });
  39. $(document).keydown(function (event) {
  40. if (event.keyCode == 13) {
  41. checkForm();
  42. }
  43. });
  44. // 判断输入框是否为空
  45. function checkForm(){
  46. if($('input[name=form_name]').val() == ''){
  47. showErrorMsg('表单名称不能为空!');
  48. $('input[name=form_name]').focus();
  49. return false;
  50. }
  51. layer_loading('正在处理');
  52. $.ajax({
  53. type : 'post',
  54. url : "{:url('Form/field_add', ['_ajax'=>1])}",
  55. data : $('#post_form').serialize(),
  56. dataType : 'json',
  57. success : function(res){
  58. layer.closeAll();
  59. if(res.code == 1){
  60. var _parent = parent;
  61. _parent.layer.close(parentObj);
  62. _parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  63. _parent.window.location.reload();
  64. });
  65. }else{
  66. showErrorMsg(res.msg);
  67. }
  68. },
  69. error: function(e){
  70. layer.closeAll();
  71. showErrorAlert(e.responseText);
  72. }
  73. });
  74. }
  75. </script>
  76. {include file="public/footer" /}