/* * Create by Vins 2008/04/07 * Action MODIFY Form Control */ function mbbs_submitform() { var m_catetype = document.getElementById("mbbs_catetype"); var m_subject = document.getElementById("mbbs_subject"); var m_contenttext = document.getElementById("mbbs_contenttext"); var m_file = document.getElementById("mbbs_file"); var catetype = ""; var subject = ""; var contenttext = ""; var userfile = ""; if(m_catetype!=null) { if (m_catetype.value == "") { alert('カテゴリを選択してください。'); m_catetype.focus(); //m_catetype.select(); return; } catetype = m_catetype.value; } m_subject.value = trim(m_subject.value); if (m_subject.value == "") { alert('タイトルを入力してください。'); m_subject.focus(); return; } m_contenttext.value = trim(m_contenttext.value); if (m_contenttext.value == "") { alert('内容を入力してください。'); m_contenttext.focus(); return; } if(m_file!=null) { userfile = m_file.value } subject = m_subject.value; contenttext = m_contenttext.value; document.mbbs_writeform.method="POST"; document.mbbs_writeform.action="action.php"; document.mbbs_writeform.target="mbbs_ifrm_writebody"; document.mbbs_writeform.submit(); } function mbbs_cancleform(locateURI) { /* document.mbbs_writeform.method="POST"; document.mbbs_writeform.action=locateURI; document.mbbs_writeform.target="_self"; document.mbbs_writeform.submit(); */ history.go(-1); } function mbbs_actionMessage(locateURI, actCode, actMsg) { if(actCode!=0) { //alert("エラー!!\n" + actMsg + "\nエラーコード : " + actCode); alert(actMsg); } else { alert(actMsg); if(locateURI != "none"){ document.mbbs_writeform.method="POST"; document.mbbs_writeform.action=locateURI; document.mbbs_writeform.target="_self"; document.mbbs_writeform.submit(); } } } function mbbs_content_delete() { document.forms["mbbs_contentForm"].mbbs_linklist.value = "list.php"; var httpParameter = f_getFormValues("mbbs_contentForm"); httpParameter += "&mbbs_actionmode=CD"; var urlfileapp = "action.php"; AjaxCore_openSendStatus("post", urlfileapp, true, httpParameter, mbbs_showActionResult); } function mbbs_point_write(point) { document.forms["mbbs_contentForm"].mbbs_linklist.value = "content.php"; var httpParameter = f_getFormValues("mbbs_contentForm"); httpParameter += "&mbbs_point="+point+"&mbbs_actionmode=PI"; var urlfileapp = "action.php"; AjaxCore_openSendStatus("post", urlfileapp, true, httpParameter, mbbs_showActionResult); } function mbbs_memo_write() { if(trim(document.forms["mbbs_memoForm"].mbbs_memoContent.value) == ""){ alert('コメントを入力してください。'); }else{ document.forms["mbbs_memoForm"].mbbs_linklist.value = "content.php"; var httpParameter = f_getFormValues("mbbs_memoForm"); httpParameter += "&mbbs_actionmode=MI"; var urlfileapp = "action.php"; AjaxCore_openSendStatus("post", urlfileapp, true, httpParameter, mbbs_showActionResult); } } function mbbs_memo_delete(dmcd) { document.forms["mbbs_memoForm"].mbbs_linklist.value = "content.php"; var httpParameter = f_getFormValues("mbbs_memoForm"); httpParameter += "&mbbs_dmcd="+dmcd+"&mbbs_actionmode=MD"; var urlfileapp = "action.php"; AjaxCore_openSendStatus("post", urlfileapp, true, httpParameter, mbbs_showActionResult); } function mbbs_content_write() { document.forms["mbbs_contentForm"].action = "write.php"; document.forms["mbbs_contentForm"].method = "POST"; document.forms["mbbs_contentForm"].submit(); } function mbbs_content_modify() { document.forms["mbbs_contentForm"].action = "modify.php"; document.forms["mbbs_contentForm"].method = "POST"; document.forms["mbbs_contentForm"].submit(); } function mbbs_content_reply() { document.forms["mbbs_contentForm"].action = "reply.php"; document.forms["mbbs_contentForm"].method = "POST"; document.forms["mbbs_contentForm"].submit(); } function mbbs_content_list() { document.forms["mbbs_contentForm"].action = "list.php"; document.forms["mbbs_contentForm"].method = "POST"; document.forms["mbbs_contentForm"].mbbs_datacd.value = ""; document.forms["mbbs_contentForm"].mbbs_memopageno.value = ""; document.forms["mbbs_contentForm"].method = "POST"; document.forms["mbbs_contentForm"].submit(); } function f_getFormValues(formname) { var forms = document.forms[formname]; var httpParameter = ""; for(var i=0;i0 && ( val.charAt(j-1) ==' ' || val.charAt(j-1) == ' ' ) ; j-- ) ; return i>=j ? "" : val.substring(i,j); }