form.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {extend name="default/base/base_member" /}
  2. {block name="member_main"}
  3. <div class="dsm-default-form fl">
  4. <form method="post" action="" id="memberbank_form">
  5. <dl>
  6. <dt>{$Think.lang.memberbank_type}:</dt>
  7. <dd>
  8. <span class="w400">
  9. <select name="memberbank_type" id="memberbank_type">
  10. <option value="bank" {if $memberbank.memberbank_type== 'bank'}selected{/if}>银行转账</option>
  11. <option value="alipay" {if $memberbank.memberbank_type== 'alipay'}selected{/if}>支付宝</option>
  12. </select>
  13. </span>
  14. </dd>
  15. </dl>
  16. <dl>
  17. <dt>{$Think.lang.memberbank_truename}:</dt>
  18. <dd>
  19. <span class="w400">
  20. <input type="text" class="text" maxlength="20" name="memberbank_truename" value="{$memberbank.memberbank_truename|default=''}">
  21. </span>
  22. <p class="hint mt5">请填写收款人姓名,该收款人姓名=银行卡开户人姓名</p>
  23. </dd>
  24. </dl>
  25. <dl id="dl_memberbank_name" {if $memberbank.memberbank_type== 'alipay'}style="display:none"{/if}>
  26. <dt>{$Think.lang.memberbank_name}:</dt>
  27. <dd>
  28. <span class="w400">
  29. <input type="text" class="text" maxlength="20" name="memberbank_name" id="memberbank_name" value="{$memberbank.memberbank_name|default=''}">
  30. </span>
  31. </dd>
  32. </dl>
  33. <dl>
  34. <dt>{$Think.lang.memberbank_no}:</dt>
  35. <dd>
  36. <span class="w400">
  37. <input type="text" class="text" maxlength="20" name="memberbank_no" id="memberbank_no" value="{$memberbank.memberbank_no|default=''}">
  38. </span>
  39. </dd>
  40. </dl>
  41. <dl class="bottom">
  42. <dt></dt>
  43. <dd>
  44. <input type="submit" class="submit" value="{$Think.lang.ds_submit}">
  45. </dd>
  46. </dl>
  47. </form>
  48. </div>
  49. <script>
  50. $(document).ready(function () {
  51. $('#memberbank_form').validate({
  52. submitHandler: function (form) {
  53. ds_ajaxpost('memberbank_form', 'url', "{:url('Memberbank/add')}");
  54. },
  55. rules: {
  56. memberbank_truename: {
  57. required: true
  58. },
  59. memberbank_no: {
  60. required: true
  61. }
  62. },
  63. messages: {
  64. memberbank_truename: {
  65. required: '{$Think.lang.please_fill_memberbank_truename}'
  66. },
  67. memberbank_no: {
  68. required: '{$Think.lang.please_fill_memberbank_no}'
  69. }
  70. }
  71. });
  72. $('#memberbank_type').change(function () {
  73. switch ($(this).val()) {
  74. case 'bank':
  75. $('#dl_memberbank_name').show();
  76. break;
  77. case 'alipay':
  78. $('#dl_memberbank_name').hide();
  79. break;
  80. }
  81. });
  82. });
  83. </script>
  84. {/block}