add.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form id="user_form" enctype="multipart/form-data" method="post">
  4. <table class="ds-default-table">
  5. <tbody>
  6. <tr class="noborder">
  7. <td class="required w120"><label class="validation" for="member_name">{$Think.lang.ds_member_name}:</label></td>
  8. <td class="vatop rowform"><input type="text" value="" name="member_name" id="member_name" class="txt"></td>
  9. <td class="vatop tips"></td>
  10. </tr>
  11. <tr class="noborder">
  12. <td class="required"><label class="validation" for="member_password">{$Think.lang.ds_member_password}:</label></td>
  13. <td class="vatop rowform"><input type="text" id="member_password" name="member_password" class="txt"></td>
  14. <td class="vatop tips"></td>
  15. </tr>
  16. <tr class="noborder">
  17. <td class="required"><label for="member_email">{$Think.lang.member_email}:</label></td>
  18. <td class="vatop rowform"><input type="text" value="" id="member_email" name="member_email" class="txt"></td>
  19. <td class="vatop tips"></td>
  20. </tr>
  21. <tr class="noborder">
  22. <td class="required"><label for="member_truename">{$Think.lang.member_truename}:</label></td>
  23. <td class="vatop rowform"><input type="text" value="" id="member_truename" name="member_truename" class="txt"></td>
  24. <td class="vatop tips"></td>
  25. </tr>
  26. <tr class="noborder">
  27. <td class="required"><label> {$Think.lang.member_edit_sex}:</label></td>
  28. <td class="vatop rowform">
  29. <label class="radio-label">
  30. <i class="radio-common selected">
  31. <input type="radio" value="0" name="member_sex" checked="checked">
  32. </i>
  33. <span>{$Think.lang.member_edit_secret}</span>
  34. </label>
  35. <label class="radio-label">
  36. <i class="radio-common">
  37. <input type="radio" value="1" name="member_sex">
  38. </i>
  39. <span>{$Think.lang.member_edit_male}</span>
  40. </label>
  41. <label class="radio-label">
  42. <i class="radio-common">
  43. <input type="radio" value="2" name="member_sex">
  44. </i>
  45. <span>{$Think.lang.member_edit_female}</span>
  46. </label>
  47. </td>
  48. <td class="vatop tips"></td>
  49. </tr>
  50. <tr class="noborder">
  51. <td class="required"><label for="member_qq">QQ:</label></td>
  52. <td class="vatop rowform"><input type="text" value="" id="member_qq" name="member_qq" class="txt"></td>
  53. <td class="vatop tips"></td>
  54. </tr>
  55. <tr class="noborder">
  56. <td class="required"><label class="member_ww">{$Think.lang.member_ww}:</label></td>
  57. <td class="vatop rowform"><input type="text" value="" id="member_ww" name="member_ww" class="txt"></td>
  58. <td class="vatop tips"></td>
  59. </tr>
  60. </tbody>
  61. <tfoot>
  62. <tr class="tfoot">
  63. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  64. </tr>
  65. </tfoot>
  66. </table>
  67. </form>
  68. </div>
  69. <script type="text/javascript">
  70. $(function() {
  71. $('#user_form').validate({
  72. errorPlacement: function(error, element) {
  73. error.appendTo(element.parent().parent().find('td:last'));
  74. },
  75. rules: {
  76. member_name: {
  77. required: true,
  78. minlength: 3,
  79. maxlength: 15,
  80. remote: {
  81. url: "{:url('Member/ajax',['branch'=>'check_user_name'])}",
  82. type: 'get',
  83. data: {
  84. user_name: function() {
  85. return $('#member_name').val();
  86. },
  87. member_id:'{$member_array.member_id|default=0}'
  88. }
  89. }
  90. },
  91. member_password: {
  92. required: true,
  93. maxlength: 20,
  94. minlength: 6
  95. },
  96. member_email: {
  97. email: true,
  98. remote: {
  99. url: "{:url('Member/ajax',['branch'=>'check_email'])}",
  100. type: 'get',
  101. data: {
  102. user_name: function() {
  103. return $('#member_email').val();
  104. },
  105. member_id: '{$member_array.member_id|default=0}'
  106. }
  107. }
  108. },
  109. member_qq: {
  110. digits: true,
  111. minlength: 5,
  112. maxlength: 11
  113. }
  114. },
  115. messages: {
  116. member_name: {
  117. required: '{$Think.lang.member_add_name_null}',
  118. maxlength: '{$Think.lang.member_add_name_length}',
  119. minlength: '{$Think.lang.member_add_name_length}',
  120. remote: '{$Think.lang.member_add_name_exists}'
  121. },
  122. member_password: {
  123. required: '{$Think.lang.password_add_name_null}',
  124. maxlength: '{$Think.lang.member_edit_password_tip}',
  125. minlength: '{$Think.lang.member_edit_password_tip}'
  126. },
  127. member_email: {
  128. email: '{$Think.lang.member_edit_valid_email}',
  129. remote: '{$Think.lang.member_edit_email_exists}'
  130. },
  131. member_qq: {
  132. digits: '{$Think.lang.member_edit_qq_wrong}',
  133. minlength: '{$Think.lang.member_edit_qq_wrong}',
  134. maxlength: '{$Think.lang.member_edit_qq_wrong}'
  135. }
  136. }
  137. });
  138. });
  139. </script>