admin_form.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form method="post" id="admin_form">
  4. <table class="ds-default-table">
  5. <tbody>
  6. <tr class="noborder">
  7. <td class="required w120">{$Think.lang.admin_index_username}</td>
  8. {if isset($admin)}
  9. <td class="vatop rowform">{$admin.admin_name}</td>
  10. {else /}
  11. <td class="vatop rowform"><input id="admin_name" name="admin_name" value="" class="input-txt" type="text"></td>
  12. <td class="vatop tips">{$Think.lang.admin_add_username_tip}</td>
  13. {/if}
  14. </tr>
  15. <tr class="noborder">
  16. <td class="required w120">{$Think.lang.admin_edit_admin_pw}</td>
  17. <td class="vatop rowform"><input id="admin_password" name="admin_password" value="" class="input-txt" type="password"></td>
  18. <td class="vatop tips">{$Think.lang.admin_edit_pwd_tip1}</td>
  19. </tr>
  20. <tr class="noborder">
  21. <td class="required w120">{$Think.lang.admin_edit_admin_pw2}</td>
  22. <td class="vatop rowform"><input id="admin_password2" name="admin_password2" value="" class="input-txt" type="password"></td>
  23. <td></td>
  24. </tr>
  25. {neq name="admin.admin_is_super" value="1"}
  26. <tr class="noborder">
  27. <td class="required w120">{$Think.lang.gadmin_name}</td>
  28. <td class="vatop rowform">
  29. <select name="gid">
  30. {foreach name="gadmin" item="v"}
  31. <option value="{$v.gid}">{$v.gname}</option>
  32. {/foreach}
  33. </select>
  34. </td>
  35. <td class="vatop tips">{$Think.lang.admin_add_gid_tip}</td>
  36. </tr>
  37. {/neq}
  38. </tbody>
  39. <tfoot>
  40. <tr class="tfoot">
  41. <td colspan="15">
  42. <input class="btn" type="submit" value="{$Think.lang.ds_confirm_submit}"/>
  43. </td>
  44. </tr>
  45. </tfoot>
  46. </table>
  47. </form>
  48. </div>
  49. <script>
  50. $(document).ready(function () {
  51. $("#admin_form").validate({
  52. errorPlacement: function (error, element) {
  53. error.appendTo(element.parent().parent().find('td:last'));
  54. },
  55. rules: {
  56. admin_name: {
  57. required: true,
  58. remote: {
  59. url: ADMINSITEURL+'/admin/ajax.html?branch=check_admin_name',
  60. type: 'get',
  61. data: {
  62. gname: function() {
  63. return $('#admin_name').val();
  64. }
  65. }
  66. }
  67. },
  68. admin_password: {
  69. minlength: 6,
  70. maxlength: 20
  71. },
  72. admin_password2: {
  73. minlength: 6,
  74. maxlength: 20,
  75. equalTo: '#admin_password'
  76. },
  77. gid: {
  78. required: true
  79. }
  80. },
  81. messages: {
  82. admin_name: {
  83. required: '{$Think.lang.ds_none_input}',
  84. remote: '{$Think.lang.admin_add_admin_not_exists}'
  85. },
  86. admin_password: {
  87. minlength: '{$Think.lang.admin_add_password_max}',
  88. maxlength: '{$Think.lang.admin_add_password_max}'
  89. },
  90. admin_password2: {
  91. minlength: '{$Think.lang.admin_add_password_max}',
  92. maxlength: '{$Think.lang.admin_add_password_max}',
  93. equalTo: '{$Think.lang.admin_edit_repeat_error}'
  94. },
  95. gid: {
  96. required: '{$Think.lang.admin_add_gid_null}',
  97. }
  98. }
  99. });
  100. });
  101. </script>