album_add.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {if $class_count <20}
  2. <div class="eject_con">
  3. <div id="warning" class="alert alert-error"></div>
  4. <form id="category_form" method="post" target="_parent" action="{:url('Selleralbum/album_add_save')}">
  5. <dl>
  6. <dt><i class="required">*</i>{$Think.lang.album_class_add_name}{$Think.lang.ds_colon}</dt>
  7. <dd>
  8. <input class="w300 text" type="text" name="name" id="name" value="" />
  9. </dd>
  10. </dl>
  11. <dl>
  12. <dt><i class="required">*</i>{$Think.lang.album_class_add_des}{$Think.lang.ds_colon}</dt>
  13. <dd>
  14. <textarea class="w300 textarea" rows="3" name="description" id="description"></textarea>
  15. </dd>
  16. </dl>
  17. <dl>
  18. <dt><i class="required">*</i>{$Think.lang.album_class_add_sort}{$Think.lang.ds_colon}</dt>
  19. <dd>
  20. <input class="w50 text" type="text" name="sort" id="sort" value="" />
  21. </dd>
  22. </dl>
  23. <div class="bottom">
  24. <input type="submit" class="submit" value="{$Think.lang.album_class_add_submit}" />
  25. </div>
  26. </form>
  27. </div>
  28. {else/}
  29. <div class="warning-option"><i class="iconfont">&#xe64c;&nbsp;</i><span>{$Think.lang.album_class_add_max_20}</span></div>
  30. {/if}
  31. <script type="text/javascript">
  32. $(function() {
  33. $('#category_form').validate({
  34. errorLabelContainer: $('#warning'),
  35. invalidHandler: function(form, validator) {
  36. $('#warning').show();
  37. },
  38. submitHandler: function(form) {
  39. ds_ajaxpost('category_form')
  40. },
  41. rules: {
  42. name: {
  43. required: true,
  44. maxlength: 20,
  45. remote: {
  46. url: "{:url('Selleralbum/ajax_check_class_name',['column'=>'ok'])}",
  47. type: 'get',
  48. data: {
  49. ac_name: function() {
  50. return $('#name').val();
  51. }
  52. }
  53. }
  54. },
  55. description: {
  56. maxlength: 100
  57. },
  58. sort: {
  59. digits: true
  60. }
  61. },
  62. messages: {
  63. name: {
  64. required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.album_class_add_name_null}',
  65. maxlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.album_class_add_name_max}',
  66. remote: '<i class="iconfont">&#xe64c;</i>{$Think.lang.album_class_add_name_repeat}'
  67. },
  68. description: {
  69. maxlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.album_class_add_des_max}'
  70. },
  71. sort: {
  72. digits: '<i class="iconfont">&#xe64c;</i>{$Think.lang.album_class_add_sort_digits}'
  73. }
  74. }
  75. });
  76. });
  77. </script>