暫無描述
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.

pack_add.htm 3.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;min-width:auto;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page pb10" style="min-width: auto;box-shadow:none;">
  7. <form class="form-horizontal" id="post_form" action="{:url('Language/pack_add')}" method="post">
  8. <div class="ncap-form-default pb10">
  9. <dl class="row">
  10. <dt class="tit">
  11. <label for="name"><em>*</em>变量名</label>
  12. </dt>
  13. <dd class="opt" style="width: auto;">
  14. <input type="text" name="name" value="" id="name" class="input-txt" onkeyup="this.value=this.value.replace(/[^a-zA-Z0-9_-]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\[^a-zA-Z0-9_-]/g,''));">
  15. <span class="err"></span>
  16. <p class="notic">保持唯一性,不可重复</p>
  17. <p class="">仅支持字母、数字、下划线、连接符,不区分大小写</p>
  18. </dd>
  19. </dl>
  20. <dl class="row"><dt class="tit"><label><b>语言名称</b></label></dt><dd class="opt" style="width: auto;"><label><b>变量值</b></label></dd></dl>
  21. {volist name='$languageRow' id='vo'}
  22. <dl class="row">
  23. <dt class="tit">
  24. <label for="value">{$vo.title}</label>
  25. </dt>
  26. <dd class="opt" style="width: auto;">
  27. <input type="text" name="value[{$vo.mark}]" value="" class="input-txt">
  28. <span class="err"></span>
  29. <p class="notic"></p>
  30. </dd>
  31. </dl>
  32. {/volist}
  33. <div class="bot mt30">
  34. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  35. </div>
  36. </div>
  37. </form>
  38. </div>
  39. <script type="text/javascript">
  40. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  41. // 判断输入框是否为空
  42. function checkForm(){
  43. var name = $.trim($('#name').val());
  44. var reg = /(^sys([0-9]+)$)/;
  45. if(name == ''){
  46. showErrorMsg('变量名不能为空!');
  47. $('#name').focus();
  48. return false;
  49. } else if (reg.test(name)) {
  50. showErrorMsg('禁止使用sys+数字的变量名,请更换');
  51. $('#name').focus();
  52. return false;
  53. }
  54. layer_loading('正在处理');
  55. $.ajax({
  56. type : 'post',
  57. url : "{:url('Language/pack_add', ['_ajax'=>1])}",
  58. data : $('#post_form').serialize(),
  59. dataType : 'json',
  60. success : function(res){
  61. layer.closeAll();
  62. if(res.code == 1){
  63. var _parent = parent;
  64. _parent.layer.close(parentObj);
  65. _parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  66. _parent.window.location.reload();
  67. });
  68. }else{
  69. showErrorMsg(res.msg);
  70. }
  71. },
  72. error: function(e){
  73. layer.closeAll();
  74. showErrorAlert(e.responseText);
  75. }
  76. });
  77. }
  78. </script>
  79. {include file="public/footer" /}