class_form.html 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form id="add_form" method="post" enctype="multipart/form-data">
  4. <table class="ds-default-table">
  5. <tbody>
  6. <tr class="noborder">
  7. <td colspan="2" class="required"><label class="validation" for="vrgclass_name">{$Think.lang.vrgroupbuy_cate_name}{$Think.lang.ds_colon}</label></td>
  8. </tr>
  9. <tr class="noborder">
  10. <td class="vatop rowform">
  11. <input type="text" name="vrgclass_name" id="vrgclass_name" class="txt" value="{$class.vrgclass_name|default=''}">
  12. </td>
  13. <td class="vatop tips"></td>
  14. </tr>
  15. {empty name="$class"}
  16. <tr>
  17. <td colspan="2" class="required"><label for="vrgclass_parent_id">{$Think.lang.vrgclass_parent_id}{$Think.lang.ds_colon}</label></td>
  18. </tr>
  19. <tr class="noborder">
  20. <td class="vatop rowform"><select id="vrgclass_parent_id" name="vrgclass_parent_id" class="valid" >
  21. <option value="0">{$Think.lang.ds_common_pselect}</option>
  22. {notempty name="vrgroupbuyclass_list"}
  23. {foreach name="vrgroupbuyclass_list" item="val"}
  24. <option value="{$val.vrgclass_id}" {if $vrgclass_parent_id == $val.vrgclass_id}selected{/if}>{$val.vrgclass_name}</option>
  25. {/foreach}
  26. {/notempty}
  27. </select>
  28. </td>
  29. <td class="vatop tips"></td>
  30. </tr>
  31. {/empty}
  32. <tr>
  33. <td colspan="2" class="required"><label for="vrgclass_sort" class="validation">{$Think.lang.ds_sort}{$Think.lang.ds_colon}</label></td>
  34. </tr>
  35. <tr class="noborder">
  36. <td class="vatop rowform"><input id="vrgclass_sort" name="vrgclass_sort" type="text" class="txt" value="{$class.vrgclass_sort|default=''}" /></td>
  37. <td class="vatop tips">{$Think.lang.class_sort_explain}</td>
  38. </tr>
  39. </tbody>
  40. <tfoot>
  41. <tr>
  42. <td colspan="2">
  43. <input class="btn" type="submit" value="{$Think.lang.ds_submit}"/>
  44. </td>
  45. </tr>
  46. </tfoot>
  47. </table>
  48. </form>
  49. </div>
  50. <script type="text/javascript">
  51. $(function(){
  52. $('#add_form').validate({
  53. errorPlacement: function(error, element){
  54. error.appendTo(element.parent().parent().prev().find('td:first'));
  55. },
  56. rules : {
  57. vrgclass_name: {
  58. required : true,
  59. maxlength : 10
  60. },
  61. vrgclass_sort: {
  62. required : true,
  63. max: 255,
  64. min: 0
  65. }
  66. },
  67. messages : {
  68. vrgclass_name: {
  69. required : "{$Think.lang.vrgclass_name_required}",
  70. maxlength : "{$Think.lang.vrgclass_name_maxlength}"
  71. },
  72. vrgclass_sort: {
  73. required : "{$Think.lang.vrgclass_sort_required}",
  74. max : "{$Think.lang.vrgclass_sort_max}",
  75. min : "{$Think.lang.vrgclass_sort_max}"
  76. }
  77. }
  78. });
  79. });
  80. </script>