Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

field_edit.htm 3.3KB

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