You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.5 KiB

  1. <?=form_open_multipart()?>
  2. <?=validation_errors('<p class="alert alert-danger">')?>
  3. <?php if(! $this->member->is_login()) :?>
  4. <input placeholder="작성자" name="qna_name" required>
  5. <input type="password" placeholder="비밀번호" name="qna_password" required>
  6. <?php endif;?>
  7. <input placeholder="연락처" data-regex="phone-number" name="qna_phone" value="<?=$this->member->info('phone')?>" required>
  8. <input placeholder="E-mail" data-regex="email-address" name="qna_email" value="<?=$this->member->info('email')?>" required>
  9. <?php if(count($qna_category) > 0) :?>
  10. <select name="qnc_idx">
  11. <?php foreach($qna_category as $row):?>
  12. <option value="<?=$row['qnc_idx']?>"><?=$row['qnc_title']?></option>
  13. <?php endforeach;?>
  14. </select>
  15. <?php endif;?>
  16. <input placeholder="질문 제목" name="qna_title" required>
  17. <textarea placeholder="질문 내용" name="qna_content" rows="10" required></textarea>
  18. <div data-container="file-input"></div>
  19. <script id="tmpl-file-input" type="text/x-jquery-tmpl">
  20. <input type="file" name="userfile[]">
  21. </script>
  22. <button type="button" data-button="add-file-input"><i class="fal fa-plus"></i> 파일 추가</button>
  23. <button>질문 등록하기</button>
  24. <?=form_close()?>
  25. <script>
  26. $(function() {
  27. $('[data-button="add-file-input"]').click(function() {
  28. $('[data-container="file-input"]').append( $('#tmpl-file-input').tmpl() );
  29. });
  30. });
  31. </script>