form.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-empty"></div>
  4. <form id="store_class_form" method="post">
  5. <table class="ds-default-table">
  6. <tbody>
  7. <tr class="noborder">
  8. <td class="required w120"><label class="validation" class="storeclass_name">{$Think.lang.store_class_name}:</label></td>
  9. <td class="vatop rowform"><input type="text" value="{$storeclass.storeclass_name|default=''}" name="storeclass_name" id="storeclass_name" class="txt"></td>
  10. <td class="vatop tips"></td>
  11. </tr>
  12. <tr class="noborder">
  13. <td class="required"><label class="validation" for="storeclass_name">{$Think.lang.store_class_bail}:</label></td>
  14. <td class="vatop rowform"><input type="text" value="{$storeclass.storeclass_bail|default=''}" name="storeclass_bail" id="storeclass_bail" class="txt"></td>
  15. <td class="vatop tips"></td>
  16. </tr>
  17. <tr class="noborder">
  18. <td class="required"><label for="storeclass_sort">{$Think.lang.ds_sort}:</label></td>
  19. <td class="vatop rowform"><input type="text" value="{$storeclass.storeclass_sort|default='0'}" name="storeclass_sort" id="storeclass_sort" class="txt"></td>
  20. <td class="vatop tips">{$Think.lang.update_sort}</td>
  21. </tr>
  22. </tbody>
  23. <tfoot>
  24. <tr class="tfoot">
  25. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  26. </tr>
  27. </tfoot>
  28. </table>
  29. </form>
  30. </div>
  31. <script>
  32. $(document).ready(function () {
  33. $('#store_class_form').validate({
  34. errorPlacement: function (error, element) {
  35. error.appendTo(element.parent().parent().find('td:last'));
  36. },
  37. rules: {
  38. storeclass_name: {
  39. required: true
  40. },
  41. storeclass_bail: {
  42. required: true,
  43. digits: true
  44. },
  45. storeclass_sort: {
  46. number: true,
  47. min: 0
  48. }
  49. },
  50. messages: {
  51. storeclass_name: {
  52. required: '{$Think.lang.store_class_name_no_null}',
  53. },
  54. storeclass_bail: {
  55. required: '{$Think.lang.ds_required_error}',
  56. digits: "{$Think.lang.ds_digits_error}",
  57. },
  58. storeclass_sort: {
  59. number: '{$Think.lang.store_class_sort_only_number}',
  60. min: '{$Think.lang.ds_min_error}0'
  61. }
  62. }
  63. });
  64. });
  65. </script>