article_class_edit.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-empty"></div>
  4. <form id="article_class_form" method="post" name="articleClassForm">
  5. <table class="ds-default-table">
  6. <tbody>
  7. <tr class="noborder">
  8. <td colspan="2" class="required">
  9. <label class="validation" for="ac_name">{$Think.lang.ac_name}:</label>
  10. </td>
  11. </tr>
  12. <tr class="noborder">
  13. <td class="vatop rowform">
  14. <input type="text" value="{$class_array.ac_name|default=''}" name="ac_name" id="ac_name" class="txt">
  15. </td>
  16. <td class="vatop tips">{$Think.lang.ac_name_tips}</td>
  17. </tr>
  18. {empty name="class_array"}
  19. <tr>
  20. <td colspan="2" class="required">
  21. <label for="parent_id">{$Think.lang.article_class_add_sup_class}:</label>
  22. </td>
  23. </tr>
  24. <tr class="noborder">
  25. <td class="vatop rowform">
  26. <select name="ac_parent_id" id="ac_parent_id">
  27. <option value="0">{$Think.lang.ds_please_choose}...</option>
  28. {notempty name="parent_list"}
  29. {foreach name="parent_list" item="v"}
  30. <option {if $ac_parent_id == $v.ac_id}selected='selected'{/if} value="{$v.ac_id}">{$v.ac_name|raw}</option>
  31. {/foreach}
  32. {/notempty}
  33. </select>
  34. </td>
  35. <td class="vatop tips">{$Think.lang.article_class_add_sup_class_notice}</td>
  36. </tr>
  37. {/empty}
  38. <tr>
  39. <td colspan="2" class="required">
  40. <label for="ac_sort">{$Think.lang.ds_sort}:</label>
  41. </td>
  42. </tr>
  43. <tr class="noborder">
  44. <td class="vatop rowform">
  45. <input type="text" value="{$class_array.ac_sort|default=''}" name="ac_sort" id="ac_sort" class="txt"></td>
  46. <td class="vatop tips">{$Think.lang.article_class_add_update_sort}</td>
  47. </tr>
  48. </tbody>
  49. <tfoot>
  50. <tr class="tfoot">
  51. <td colspan="15" >
  52. <input class="btn" type="submit" value="{$Think.lang.ds_submit}"/>
  53. </td>
  54. </tr>
  55. </tfoot>
  56. </table>
  57. </form>
  58. </div>
  59. <script>
  60. $(document).ready(function () {
  61. $('#article_class_form').validate({
  62. errorPlacement: function (error, element) {
  63. error.appendTo(element.parent().parent().prev().find('td:first'));
  64. },
  65. rules: {
  66. ac_name: {
  67. required: true,
  68. remote: {
  69. url: ADMINSITEURL + '/Articleclass/Ajax/branch/check_class_name',
  70. type: 'get',
  71. data: {
  72. ac_name: function () {
  73. return $('#ac_name').val();
  74. },
  75. ac_parent_id: function () {
  76. return $('#ac_parent_id').val();
  77. },
  78. ac_id: "{$class_array.ac_id|default=''}"
  79. }
  80. }
  81. },
  82. ac_sort: {
  83. number: true,
  84. range : [0,255]
  85. }
  86. },
  87. messages: {
  88. ac_name: {
  89. required: "{$Think.lang.article_class_add_name_null}",
  90. remote: "{$Think.lang.article_class_add_name_exists}"
  91. },
  92. ac_sort: {
  93. number: "{$Think.lang.article_class_add_sort_int}",
  94. range: '{$Think.lang.ds_range_0_255}'
  95. }
  96. }
  97. });
  98. });
  99. </script>