form.html 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="ds-default-table">
  4. <form id="storegrade_form" method="post">
  5. <table>
  6. <tbody>
  7. <tr class="noborder">
  8. <td class="required w120">{$Think.lang.storegrade_name}</td>
  9. <td class="vatop rowform"><input type="text" name="storegrade_name" id="storegrade_name" value="{$storegrade.storegrade_name|default=''}" class="w200"/></td>
  10. <td></td>
  11. </tr>
  12. <tr class="noborder">
  13. <td class="required w120">{$Think.lang.storegrade_goods_limit}</td>
  14. <td class="vatop rowform"><input type="text" name="storegrade_goods_limit" id="storegrade_goods_limit" value="{$storegrade.storegrade_goods_limit|default='0'}" class="w200"/></td>
  15. <td></td>
  16. </tr>
  17. <tr class="noborder">
  18. <td class="required w120">{$Think.lang.storegrade_album_limit}</td>
  19. <td class="vatop rowform"><input type="text" name="storegrade_album_limit" id="storegrade_album_limit" value="{$storegrade.storegrade_album_limit|default='0'}" class="w200"/></td>
  20. <td></td>
  21. </tr>
  22. <tr class="noborder">
  23. <td class="required w120">{$Think.lang.storegrade_price}</td>
  24. <td class="vatop rowform"><input type="text" name="storegrade_price" id="storegrade_price" value="{$storegrade.storegrade_price|default=''}" class="w200"/></td>
  25. <td></td>
  26. </tr>
  27. <tr class="noborder">
  28. <td class="required w120">{$Think.lang.storegrade_description}</td>
  29. <td class="vatop rowform"><input type="text" name="storegrade_description" id="storegrade_description" value="{$storegrade.storegrade_description|default=''}" class="w200"/></td>
  30. <td></td>
  31. </tr>
  32. <tr class="noborder">
  33. <td class="required w120">{$Think.lang.storegrade_sort}</td>
  34. <td class="vatop rowform"><input type="text" name="storegrade_sort" id="storegrade_sort" value="{$storegrade.storegrade_sort|default='255'}" class="w200"/></td>
  35. <td></td>
  36. </tr>
  37. </tbody>
  38. <tfoot>
  39. <tr class="tfoot">
  40. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  41. </tr>
  42. </tfoot>
  43. </table>
  44. </form>
  45. </div>
  46. </div>
  47. <script type="text/javascript">
  48. $(function(){
  49. $('#storegrade_form').validate({
  50. errorPlacement: function(error, element) {
  51. error.appendTo(element.parent().parent().find('td:last'));
  52. },
  53. rules: {
  54. storegrade_name :{
  55. required: true
  56. },
  57. storegrade_sort :{
  58. required: true,
  59. number :true,
  60. range:[1,255]
  61. },
  62. storegrade_goods_limit :{
  63. digits:true
  64. },
  65. storegrade_album_limit :{
  66. digits:true
  67. }
  68. },
  69. messages: {
  70. storegrade_name :{
  71. required : '{$Think.lang.ds_required_error}'
  72. },
  73. storegrade_sort :{
  74. required : '{$Think.lang.ds_required_error}',
  75. number :'{$Think.lang.ds_sort_number}',
  76. range: '{$Think.lang.ds_range_0_255}'
  77. },
  78. storegrade_goods_limit :{
  79. digits:'{$Think.lang.ds_digits_error}'
  80. },
  81. storegrade_album_limit :{
  82. digits:'{$Think.lang.ds_digits_error}'
  83. }
  84. }
  85. });
  86. });
  87. </script>