priceadd.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form id="add_form" method="post">
  4. <table class="ds-default-table">
  5. <tbody>
  6. <tr class="noborder">
  7. <td class="required w120"><label class="validation">{$Think.lang.admin_voucher_price_title}({$Think.lang.ds_yuan}){$Think.lang.ds_colon}</label></td>
  8. <td class="vatop rowform"><input type="text" id="voucher_price" name="voucher_price" class="txt" value="{$info.voucherprice|default=''}"></td>
  9. <td class="vatop tips"></td>
  10. </tr>
  11. <tr class="noborder">
  12. <td class="required"><label class="validation">{$Think.lang.admin_voucher_price_describe}{$Think.lang.ds_colon}</label></td>
  13. <td class="vatop rowform"><textarea name="voucher_price_describe" rows="6" class="tarea" id="voucher_price_describe">{$info.voucherprice_describe|default=''}</textarea></td>
  14. <td class="vatop tips"></td>
  15. </tr>
  16. <tr class="noborder">
  17. <td class="required"><label class="validation">{$Think.lang.admin_voucher_price_points}{$Think.lang.ds_colon}</label></td>
  18. <td class="vatop rowform"><input type="text" id="voucher_points" name="voucher_points" class="txt" value="{$info.voucherprice_defaultpoints|default='0'}"></td>
  19. <td class="vatop tips">{$Think.lang.admin_voucher_price_points_tip}</td>
  20. </tr>
  21. </tbody>
  22. <tfoot>
  23. <tr class="tfoot">
  24. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  25. </tr>
  26. </tfoot>
  27. </table>
  28. </form>
  29. </div>
  30. <script>
  31. //按钮先执行验证再提交表单
  32. $(function(){
  33. //页面输入内容验证
  34. $("#add_form").validate({
  35. errorPlacement: function(error, element){
  36. error.appendTo(element.parent().parent().find('td:last'));
  37. },
  38. rules : {
  39. voucher_price_describe: {
  40. required : true,
  41. maxlength : 255
  42. },
  43. voucher_price: {
  44. required : true,
  45. digits : true,
  46. min : 0
  47. },
  48. voucher_points: {
  49. digits : true
  50. }
  51. },
  52. messages : {
  53. voucher_price_describe: {
  54. required : '{$Think.lang.admin_voucher_price_describe_error}',
  55. maxlength : '{$Think.lang.admin_voucher_price_describe_lengtherror}'
  56. },
  57. voucher_price: {
  58. required : '{$Think.lang.admin_voucher_price_error}',
  59. digits : '{$Think.lang.admin_voucher_price_error}',
  60. min : '{$Think.lang.admin_voucher_price_error}'
  61. },
  62. voucher_points: {
  63. digits : '{$Think.lang.admin_voucher_price_points_error}'
  64. }
  65. }
  66. });
  67. });
  68. </script>