에디터 내용 유효성 체크 문의드립니다 -_-
본문
안녕하세요.
게시판 형식으로 별도 페이지에서 에디터를 사용해서 값을 입력 받습니다.
---------------------------------------
<?php
include_once('./_common.php');
include_once(G5_PATH.'/head.php');
include_once(G5_EDITOR_LIB);
?>
<script type="text/javascript">
function aaaaa(f){
if (document.frmnewwin.nw_content.value=='') {
alert("내용을 입력하세요~");
oEditors.getById["nw_content"].exec("FOCUS", []);
return false;
}
return true;
}
</script>
<form name="frmnewwin" method="post" enctype="multipart/form-data" onsubmit="return aaaaa(this);">
<?php echo editor_html('nw_content';?>
<input type="submit" value="확인">
</form>
-------------------------------------------
내용을 입력하든 안하 무조건 리턴 됩니다 -_-
입력하지 않았을때만 리턴 되게 해야하는데 어떻게 할 수 있나요??
전에 도 이 내용으로 고생한적이있었는데,,,,,,, 이번에도 풀리지가 않아요 -_-
도와주세요~~~~~~~
답변 부탁드립니다.
답변 2
function aaaaa(f) {
var c = oEditors.getById["nw_content"].getIR();
if(!c) {
alert("내용을 입력하세요.");
oEditors.getById["nw_content"].exec("FOCUS", []);
return false;
}
}
왕계란님 답변 감사합니다만,
님 답변 대로 해도 내용을 쓰던 안쓰던
리턴하지 않고 느냥 넘어갑니다. -_-
부디 어린양좀 도와주세요 ㅠㅜ
ps. 게시글에 오타가 있었네요.
<?php echo editor_html('nw_content');?> 이렇게 한 상황입니다. -_-