class_add.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form id="add_form" method="post" action="{:url('Groupbuy/class_save')}">
  4. <input name="gclass_id" type="hidden" value="" />
  5. <table class="ds-default-table">
  6. <tbody>
  7. <tr class="noborder">
  8. <td colspan="2" class="required"><label for="input_gclass_name" class="validation">{$Think.lang.groupbuy_class_name}:</label></td>
  9. </tr>
  10. <tr class="noborder">
  11. <td class="vatop rowform"><input type="text" value="" name="input_gclass_name" id="input_gclass_name" class="txt"></td>
  12. <td class="vatop tips"></td>
  13. </tr>
  14. <tr>
  15. <td colspan="2" class="required"><label for="input_parent_id">{$Think.lang.groupbuy_parent_class}:</label></td>
  16. </tr>
  17. <tr class="noborder">
  18. <td class="vatop rowform">
  19. <select name="input_parent_id" id="input_parent_id">
  20. <option value="0">{$Think.lang.groupbuy_root_class}</option>
  21. {notempty name="groupbuyclass_list"}
  22. {foreach name="groupbuyclass_list" item="val"}
  23. <option {eq name="parent_id" value="$val.gclass_id" }selected='selected'{/eq} value="{$val.gclass_id}">{$val.gclass_name}</option>
  24. {/foreach}
  25. {/notempty}
  26. </select></td>
  27. <td class="vatop tips">{$Think.lang.groupbuy_parent_class_add_tip}</td>
  28. </tr>
  29. <tr>
  30. <td colspan="2" class="required"><label>{$Think.lang.ds_sort}:</label></td>
  31. </tr>
  32. <tr class="noborder">
  33. <td class="vatop rowform"><input type="text" value="0" name="input_sort" id="input_sort" class="txt"></td>
  34. <td class="vatop tips">{$Think.lang.sort_tip}</td>
  35. </tr>
  36. </tbody>
  37. <tfoot>
  38. <tr>
  39. <td colspan="2">
  40. <input class="btn" type="submit" value="{$Think.lang.ds_submit}"/>
  41. </td>
  42. </tr>
  43. </tfoot>
  44. </table>
  45. </form>
  46. </div>
  47. <script type="text/javascript">
  48. $(document).ready(function(){
  49. $('#add_form').validate({
  50. errorPlacement: function(error, element){
  51. error.appendTo(element.parent().parent().prev().find('td:first'));
  52. },
  53. rules : {
  54. input_gclass_name : {
  55. required : true
  56. },
  57. input_sort : {
  58. number : true,
  59. range : [0,255]
  60. }
  61. },
  62. messages : {
  63. input_gclass_name: {
  64. required : '{$Think.lang.class_name_error}'
  65. },
  66. input_sort: {
  67. number : '{$Think.lang.sort_error}',
  68. range : '{$Think.lang.class_sort_explain}'
  69. }
  70. }
  71. });
  72. });
  73. </script>