spec_form.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form class="" id="user_form" method="post">
  4. <div class="ds-default-table">
  5. <table>
  6. <tbody>
  7. <tr class="noborder">
  8. <td class="required w120">{$Think.lang.gc_select}</td>
  9. <td class="vatop rowform">
  10. <div id="gcategory" class="default_select">
  11. <input type="hidden" name="gc_id" value="{$spec.gc_id}" class="mls_id" />
  12. <input type="hidden" name="gc_name" value="{$spec.gc_name|default=''}" class="mls_name" />
  13. {if $spec.gc_id}
  14. <span>{$spec.gc_name|default=''}</span>
  15. <input type="button" value="{$Think.lang.ds_edit}" class="edit_gcategory" />
  16. {/if}
  17. <select {if $spec.gc_id}style="display:none"{/if}>
  18. <option value="">{$Think.lang.gc_id_required}</option>
  19. <option value="0">{$Think.lang.gc_all}</option>
  20. {foreach name="gc_list" item="gc"}
  21. <option value="{$gc.gc_id}">{$gc.gc_name}</option>
  22. {/foreach}
  23. </select>
  24. </div>
  25. </td>
  26. <td>{$Think.lang.gc_name_tips}</td>
  27. </tr>
  28. <tr class="noborder">
  29. <td class="required w120">{$Think.lang.sp_name}</td>
  30. <td class="vatop rowform">
  31. <input type="text" name="sp_name" id="sp_name" value="{$spec.sp_name|default=''}" class="w200"/>
  32. </td>
  33. </tr>
  34. <tr class="noborder">
  35. <td class="required w120">{$Think.lang.sp_sort}</td>
  36. <td class="vatop rowform">
  37. <input type="text" name="sp_sort" id="sp_sort" value="{$spec.sp_sort|default='255'}" class="w200"/>
  38. </td>
  39. <td></td>
  40. </tr>
  41. </tbody>
  42. <tfoot>
  43. <tr class="tfoot">
  44. <td></td>
  45. <td>
  46. <input class="btn" type="submit" value="{$Think.lang.ds_submit}"/>
  47. </td>
  48. </tr>
  49. </tfoot>
  50. </table>
  51. </div>
  52. </form>
  53. </div>
  54. <!--载入-->
  55. <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
  56. <script>
  57. $(function() {
  58. gcategoryInit("gcategory");
  59. });
  60. </script>
  61. <script type="text/javascript">
  62. $(function(){
  63. $('#user_form').validate({
  64. errorPlacement: function(error, element) {
  65. error.appendTo(element.parent().parent().find('td:last'));
  66. },
  67. rules: {
  68. sp_name :{
  69. required: true,
  70. },
  71. sp_sort :{
  72. required: true,
  73. digits:true,
  74. max: 255,
  75. min:0,
  76. }
  77. },
  78. messages: {
  79. sp_name :{
  80. required: '{$Think.lang.gc_id_required}',
  81. },
  82. sp_sort :{
  83. required: '{$Think.lang.sp_sort_required}',
  84. digits: '{$Think.lang.sp_sort_digits}',
  85. max: '{$Think.lang.sp_sort_max}'
  86. }
  87. }
  88. });
  89. });
  90. </script>