notice_add.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-empty"></div>
  4. <form id="notice_form" method="POST">
  5. <table class="ds-default-table">
  6. <tbody>
  7. <tr class="noborder">
  8. <td class="required w120"><label>{$Think.lang.notice_index_send_type}: </label></td>
  9. <td class="vatop rowform"><ul class="nofloat">
  10. <li>
  11. <label><input type="radio" checked="" value="1" name="send_type">{$Think.lang.notice_index_spec_member}</label>
  12. </li>
  13. <li>
  14. <label><input type="radio" value="2" name="send_type" />{$Think.lang.notice_index_all_member}</label>
  15. </li>
  16. </ul>
  17. </td>
  18. <td class="vatop tips"></td>
  19. </tr>
  20. </tbody>
  21. <tbody id="user_list">
  22. <tr class="noborder">
  23. <td class="required"><label class="validation" for="user_name">{$Think.lang.notice_index_member_list}: </label></td>
  24. <td class="vatop rowform"><textarea id="user_name" name="user_name" rows="6" class="tarea" >{:str_replace(' ','+',$Request.param.member_name)}</textarea></td>
  25. <td class="vatop tips">{$Think.lang.notice_index_member_tip}</td>
  26. </tr>
  27. </tbody>
  28. <tbody id="msg">
  29. <tr class="noborder">
  30. <td class="required"><label class="validation">{$Think.lang.notice_index_content}: </label></td>
  31. <td class="vatop rowform"><textarea name="content1" rows="6" class="tarea"></textarea></td>
  32. <td></td>
  33. </tr>
  34. </tbody>
  35. <tfoot>
  36. <tr class="tfoot">
  37. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  38. </tr>
  39. </tfoot>
  40. </table>
  41. </form>
  42. </div>
  43. <script>
  44. $(document).ready(function(){
  45. $('#notice_form').validate({
  46. errorPlacement: function(error, element){
  47. error.appendTo(element.parent().parent().find('td:last'));
  48. },
  49. rules : {
  50. user_name : {
  51. required : check_user_name
  52. },
  53. content1 :{
  54. required : true
  55. }
  56. },
  57. messages : {
  58. user_name :{
  59. required : '{$Think.lang.notice_index_member_error}'
  60. },
  61. content1 :{
  62. required : '{$Think.lang.notice_index_content_null}'
  63. }
  64. },
  65. submitHandler: function(form) {
  66. form.submit();
  67. }
  68. });
  69. function check_user_name()
  70. {
  71. var rs = $(":input[name='send_type']:checked").val();
  72. return rs == 1 ? true : false;
  73. }
  74. $("input[name='send_type']").click(function(){
  75. var rs = $(this).val();
  76. switch(rs)
  77. {
  78. case '1':
  79. $('#user_list').show();
  80. break;
  81. case '2':
  82. $('#user_list').hide();
  83. break;
  84. }
  85. });
  86. });
  87. </script>