php 구문 질문드립니다. 채택완료
갱쿤
8년 전
조회 2,122
에디터에 글내용이 없으면 내용을 입력해주십시오. 라고 경고창이 나오는데
여기에 번역문구 때문에 if문을 사용하고 싶은데 어떻게 적용을 해야하는지모르겠습니다.
위 코드를 밑에 코드 처럼 if문을 적용하고 싶은데 적용할수있는 php 구문? 이있을까요
</p><p>// textarea 의 값이 비어 있는지 검사 hyun</p><p>function chk_editor_js($id, $is_dhtml_editor=true)</p><p>{</p><p> if ($is_dhtml_editor) {</p><p> return "</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>var {$id}_editor_data_txt = {$id}_editor_data.toLowerCase();\n;</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<p\>/gi, '');\n;</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<br\>/gi, '');\n;</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<\/p\>/gi, '');\n;</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/ /gi, '');\n;</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/ /gi, '');\n;</p><p> </p><p><span class="Apple-tab-span" style="white-space:pre"> </span>if (!{$id}_editor_data_txt || !{$id}_editor_data || jQuery.inArray({$id}_editor_data.toLowerCase(), [' ',' ',' ','<p> </p>','<p> </p>','<p> </p>','<p> </p>','<p>
</p>','<p></p>','
']) != -1)<span style="color: rgb(255, 108, 0);"> <span style="color: rgb(0, 0, 0);">{</span><b> alert(\"내용을 입력해 주십시오.\");</b></span> oEditors.getById['{$id}'].exec('FOCUS'); return false; }\n";</p><p> } else {</p><p> return "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";</p><p> }</p><p>}</p><p> </p><p>
</p><p style="font-size: 14.6667px;">// textarea 의 값이 비어 있는지 검사 hyun</p><p style="font-size: 14.6667px;">function chk_editor_js($id, $is_dhtml_editor=true)</p><p style="font-size: 14.6667px;">{</p><p style="font-size: 14.6667px;"> if ($is_dhtml_editor) {</p><p style="font-size: 14.6667px;"> return "</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>var {$id}_editor_data_txt = {$id}_editor_data.toLowerCase();\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<p\>/gi, '');\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<br\>/gi, '');\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<\/p\>/gi, '');\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/ /gi, '');\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/ /gi, '');\n;</p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (!{$id}_editor_data_txt || !{$id}_editor_data || jQuery.inArray({$id}_editor_data.toLowerCase(), [' ',' ',' ','<p> </p>','<p> </p>','<p> </p>','<p> </p>','<p>
</p>','<p></p>','
']) != -1)<span style="color: rgb(255, 108, 0);"> <span style="color: rgb(0, 0, 0);">{</span><b> </b></span></p><p style="font-size: 14.6667px;"><span style="color: rgb(255, 108, 0);"><b>
</b></span></p><p style="font-size: 14.6667px;"><font color="#ff6c00"><b>if($text=="kr"){</b></font></p><p style="font-size: 14.6667px;"><b style="color: rgb(255, 108, 0); font-size: 14.6667px;">alert(\"내용을 입력해 주십시오.\");</b><font color="#ff6c00"><b>
</b></font></p><p style="font-size: 14.6667px;"><font color="#ff6c00"><b>}</b></font></p><p style="font-size: 14.6667px;"><b style="color: rgb(255, 108, 0); font-size: 14.6667px;">if($text=="en"){</b> </p><p style="font-size: 14.6667px;"><b style="color: rgb(255, 108, 0); font-size: 14.6667px;">alert(\"eeeee.\");</b><font color="#ff6c00"><b>
</b></font></p><p style="font-size: 14.6667px;"><font color="#ff6c00"><b>}</b></font></p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;"> oEditors.getById['{$id}'].exec('FOCUS'); return false; }\n";</p><p style="font-size: 14.6667px;"> } else {</p><p style="font-size: 14.6667px;"> return "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";</p><p style="font-size: 14.6667px;"> }</p><p style="font-size: 14.6667px;">}</p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;">
댓글을 작성하려면 로그인이 필요합니다.
답변 3개
답변을 작성하려면 로그인이 필요합니다.
로그인