add_reason.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-empty"></div>
  4. <form id="post_form" method="post" name="form1">
  5. <table class="ds-default-table">
  6. <tbody>
  7. <tr class="noborder">
  8. <td colspan="2" class="required"><label class="validation" for="reason_info">{$Think.lang.refund_buyer_message}:</label></td>
  9. </tr>
  10. <tr class="noborder">
  11. <td class="vatop rowform"><input id="reason_info" name="reason_info" value="" class="txt" type="text"></td>
  12. <td class="vatop tips"></td>
  13. </tr>
  14. <tr>
  15. <td colspan="2" class="required"><label class="validation" for="reason_sort">{$Think.lang.ds_sort}:</label>
  16. </td>
  17. </tr>
  18. <tr class="noborder">
  19. <td class="vatop rowform"><input type="text" value="100" name="reason_sort" id="reason_sort" class="txt"></td>
  20. <td class="vatop tips">{$Think.lang.reason_sort_tips}</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. //按钮先执行验证再提交表单
  33. $(function () {
  34. $("#post_form").validate({
  35. errorPlacement: function (error, element) {
  36. error.appendTo(element.parent().parent().prev().find('td:first'));
  37. },
  38. rules: {
  39. reason_info: {
  40. required: true
  41. },
  42. reason_sort: {
  43. required: true,
  44. digits: true,
  45. range: [0, 255]
  46. }
  47. },
  48. messages: {
  49. reason_info: {
  50. required: "{$Think.lang.reason_info_required}"
  51. },
  52. reason_sort: {
  53. required: "{$Think.lang.reason_sort_digits}",
  54. digits: "{$Think.lang.reason_sort_digits}",
  55. range: '{$Think.lang.reason_sort_tips}'
  56. }
  57. }
  58. });
  59. });
  60. </script>