form.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-form-default">
  4. <form id="store_service_form" enctype="multipart/form-data" method="post" >
  5. <dl>
  6. <dt><i class="required">*</i>{$Think.lang.store_service_title}{$Think.lang.ds_colon}</dt>
  7. <dd><input type="text" value="{present name='store_service_info'}{$store_service_info.store_service_title}{/present}" name="store_service_title" id="store_service_title" class="w200 text"><span></span>
  8. <p class="hint"></p></dd>
  9. </dl>
  10. <dl>
  11. <dt>{$Think.lang.store_service_desc}{$Think.lang.ds_colon}</dt>
  12. <dd><input type="text" value="{present name='store_service_info'}{$store_service_info.store_service_desc}{/present}" name="store_service_desc" id="store_service_desc" class="w200 text"><span></span>
  13. <p class="hint"></p></dd>
  14. </dl>
  15. <dl>
  16. <dt>{$Think.lang.ds_sort}{$Think.lang.ds_colon}</dt>
  17. <dd><input type="text" value="{present name='store_service_info'}{$store_service_info.store_service_sort}{else}255{/present}" name="store_service_sort" id="store_service_sort" class="w200 text"><span></span>
  18. <p class="hint"></p></dd>
  19. </dl>
  20. <div class="bottom">
  21. <input type="submit" class="submit" value="{$Think.lang.ds_submit}">
  22. </div>
  23. </form>
  24. </div>
  25. <script>
  26. //按钮先执行验证再提交表单
  27. $(function () {
  28. $("#store_service_form").validate({
  29. submitHandler: function (form) {
  30. ds_ajaxpost('store_service_form', 'url', '{:url("seller_service/index")}');
  31. },
  32. errorPlacement: function (error, element) {
  33. element.nextAll('span').first().after(error);
  34. },
  35. rules: {
  36. store_service_title: {
  37. required: true,
  38. },
  39. },
  40. messages: {
  41. store_service_title: {
  42. required: '{$Think.lang.store_service_title_required}',
  43. },
  44. }
  45. });
  46. });
  47. </script>
  48. {/block}