add_inajax.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <div class="eject_con">
  2. <div id="warning"></div>
  3. <form id="mallconsult_form" method="post" action="{:url('Membermallconsult/save_mallconsult')}">
  4. <dl>
  5. <dt>{$Think.lang.type_consultation}{$Think.lang.ds_colon}</dt>
  6. <dd>
  7. <div><select name="type_id" id="type_id">
  8. <option value="0">{$Think.lang.ds_please_choose}</option>
  9. {notempty name="type_list"}
  10. {foreach name="type_list" item="val"}
  11. <option value="{$val.mallconsulttype_id}">{$val.mallconsulttype_name}</option>
  12. {/foreach}
  13. {/notempty}
  14. </select>
  15. <p class="hint">{$Think.lang.customer_service_consultation_type}</p></div>
  16. <div>
  17. <div></div>
  18. {notempty name="type_list"}
  19. {foreach name="type_list" item="val"}
  20. <div style="display:none;">{:htmlspecialchars_decode($val.mallconsulttype_introduce)}</div>
  21. {/foreach}
  22. {/notempty}
  23. </div>
  24. </dd>
  25. </dl>
  26. <dl>
  27. <dt>{$Think.lang.content_consultation}{$Think.lang.ds_colon}</dt>
  28. <dd>
  29. <textarea id="consult_content" name="consult_content" class="textarea w400 h100" ></textarea>
  30. <p class="hint">{$Think.lang.question_content}<br />{$Think.lang.order_type_consultation_should}<br/>
  31. {$Think.lang.word_limit_consultation_content}</p>
  32. </dd>
  33. </dl>
  34. <div class="bottom">
  35. <input type="submit" class="submit" value="{$Think.lang.ds_submit}"/>
  36. </div>
  37. </form>
  38. </div>
  39. <script>
  40. $(function(){
  41. $('#mallconsult_form').validate({
  42. errorLabelContainer: $('#warning'),
  43. invalidHandler: function(form, validator) {
  44. $('#warning').show();
  45. },
  46. submitHandler:function(form){
  47. ds_ajaxpost('mallconsult_form');
  48. },
  49. rules : {
  50. type_id : {
  51. required : true,
  52. min : 1
  53. },
  54. consult_content : {
  55. required : true
  56. }
  57. },
  58. messages : {
  59. type_id : {
  60. required : '<i class="iconfont">&#xe64c;</i>{$Think.lang.please_select_type_consultation}',
  61. min : '<i class="iconfont">&#xe64c;</i>{$Think.lang.please_select_type_consultation}'
  62. },
  63. consult_content : {
  64. required : '<i class="iconfont">&#xe64c;</i>{$Think.lang.please_fill_information}'
  65. }
  66. }
  67. });
  68. });
  69. </script>