account_add.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-form-default">
  4. <form id="add_form" action="" method="post">
  5. <dl>
  6. <dt><i class="required">*</i>{$Think.lang.front_desk_user_name}{$Think.lang.ds_colon}</dt>
  7. <dd><input class="w120 text" name="member_name" type="text" id="member_name" value="" />
  8. <span></span>
  9. <p class="hint">{$Think.lang.must_registered_account}</p>
  10. </dd>
  11. </dl>
  12. <dl>
  13. <dt><i class="required">*</i>{$Think.lang.user_password}{$Think.lang.ds_colon}</dt>
  14. <dd><input class="w120 text" name="password" type="password" id="password" value="" />
  15. <span></span>
  16. <p class="hint"></p>
  17. </dd>
  18. </dl>
  19. <dl>
  20. <dt><i class="required">*</i>{$Think.lang.account_group}{$Think.lang.ds_colon}</dt>
  21. <dd><select name="group_id">
  22. {foreach name="seller_group_list" item="value" }
  23. <option value="{$value.sellergroup_id}">{$value.sellergroup_name}</option>
  24. {/foreach}
  25. </select>
  26. <span></span>
  27. <p class="hint"></p>
  28. </dd>
  29. </dl>
  30. <div class="bottom">
  31. <input type="submit" class="submit" value="{$Think.lang.ds_submit}">
  32. </div>
  33. </form>
  34. </div>
  35. <script>
  36. $(document).ready(function(){
  37. jQuery.validator.addMethod("check_member_password", function(value, element, params) {
  38. var result = true;
  39. $.ajax({
  40. type:"GET",
  41. url:"{:url('Selleraccount/check_seller_member')}",
  42. async:false,
  43. data:{member_name: $('#member_name').val(), password: $('#password').val()},
  44. success: function(data){
  45. if(data != 'true') {
  46. $.validator.messages.check_member_password = "{$Think.lang.user_authentication_failed}";
  47. result = false;
  48. }
  49. }
  50. });
  51. return result;
  52. }, '');
  53. $('#add_form').validate({
  54. onkeyup: false,
  55. errorPlacement: function(error, element){
  56. element.nextAll('span').first().after(error);
  57. },
  58. submitHandler:function(form){
  59. ds_ajaxpost('add_form', 'url', "{:url('Selleraccount/account_list')}");
  60. },
  61. rules: {
  62. member_name: {
  63. required: true
  64. },
  65. password: {
  66. required: true,
  67. check_member_password: true
  68. },
  69. group_id: {
  70. required: true
  71. }
  72. },
  73. messages: {
  74. member_name: {
  75. required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.foreground_username_cannot_empty}'
  76. },
  77. password: {
  78. required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.user_password_cannot_empty}',
  79. remote: '<i class="iconfont">&#xe64c;</i>{$Think.lang.wrong_username_password}'
  80. },
  81. group_id: {
  82. required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.select_account_group}'
  83. }
  84. }
  85. });
  86. });
  87. </script>
  88. {/block}