---
title: 주제 제안
title: 피드백
---
⋯
<div class="sg">
<form id="sgf" novalidate>
<label for="sgtopic">제안할 주제 *</label>
<label for="sgtopic">하고 싶은 말 *</label>
<textarea id="sgtopic" maxlength="1200" required></textarea>
<label for="sgalias">별명</label>
⋯
<small>선택</small>
<input class="hp" tabindex="-1" aria-hidden="true" id="sgweb" autocomplete="off">
<button type="submit" id="sgbtn">제안 보내기</button>
<button type="submit" id="sgbtn">보내기</button>
<div class="msg" id="sgmsg"></div>
</form>
</div>
⋯
if(!topic){ m.className='msg err'; m.textContent='내용이 비었습니다.'; return }
b.disabled=true; b.textContent='보내는 중...'
fetch('/api/consult',{method:'POST',headers:{'Content-Type':'application/json'},
body:JSON.stringify({kind:'제안',topic:topic,
body:JSON.stringify({kind:'피드백',topic:topic,
alias:document.getElementById('sgalias').value.trim(),
contact:document.getElementById('sgcontact').value.trim(),
website:document.getElementById('sgweb').value})})
.then(function(r){return r.json().catch(function(){return{}}).then(function(j){return{ok:r.ok,j:j}})})
.then(function(res){
if(res.ok){ f.style.display='none'; m.textContent='접수했습니다.' }
else { m.className='msg err'; m.textContent=(res.j&&res.j.error)||'전송 실패'; b.disabled=false; b.textContent='제안 보내기' }
else { m.className='msg err'; m.textContent=(res.j&&res.j.error)||'전송 실패'; b.disabled=false; b.textContent='보내기' }
})
.catch(function(){ m.className='msg err'; m.textContent='전송 실패'; b.disabled=false; b.textContent='제안 보내기' })
.catch(function(){ m.className='msg err'; m.textContent='전송 실패'; b.disabled=false; b.textContent='보내기' })
})
})()
</script>
⋯