다중폼

다중폼

QA

다중폼

본문


<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr><td colspan="6" height="2" class="t_box_gray"></td></tr>
  <tr>
    <td class="write-ground td-width">
      카테고리
    </td>
    <td class="td_padding">
      <form action="<?php echo $PHP_SELF ?>" method="post" name="selbo" id="selbo">
      <input type="hidden" name="selectboard" value="<?php echo $selectboard ?>">
      <input type="hidden" name="weboption" value="<?php echo $weboption ?>">
      <select name="selectboard" class="write-select" onchange="document.selbo.submit();">
        <option value="">선택해주세요</option>
        <option value="1" <?php if($selectboard == "1"){ ?>selected<?php } ?>>제작의뢰</option>
        <option value="2" <?php if($selectboard == "2"){ ?>selected<?php } ?>>Q&A</option>
        <option value="3" <?php if($selectboard == "3"){ ?>selected<?php } ?>>자유게시판</option>
        <option value="4" <?php if($selectboard == "4"){ ?>selected<?php } ?>>1:1 문의</option>
      </select>
      </form>
      <?php if($selectboard == ""){ ?>
      <?php }elseif($selectboard == "1"){ ?>
      <form action="<?php echo $PHP_SELF ?>" method="post" name="webop" id="webop">
      <input type="hidden" name="weboption" value="<?php echo $weboption ?>">
      <input type="hidden" name="selectboard" value="<?php echo $selectboard ?>">
      <select name="weboption" class="write-select" onchange="document.webop.submit();">
        <option value="">선택해주세요</option>
        <option value="11" <?php if($weboption == "11"){ ?>selected<?php } ?>>제작의뢰</option>
        <option value="12" <?php if($weboption == "12"){ ?>selected<?php } ?>>부가수정</option>
        <option value="13" <?php if($weboption == "13"){ ?>selected<?php } ?>>리뉴얼</option>
      </select>
      </form>
      <?php }elseif($selectboard == "2"){ ?>
      <form action="<?php echo $PHP_SELF ?>" method="post" name="webop" id="webop">
      <input type="hidden" name="weboption" value="<?php echo $weboption ?>">
      <input type="hidden" name="selectboard" value="<?php echo $selectboard ?>">
      <select name="weboption" class="write-select" onchange="document.webop.submit();">
        <option value="">선택해주세요</option>
        <option value="11" <?php if($weboption == "11"){ ?>selected<?php } ?>>php/mysql</option>
        <option value="12" <?php if($weboption == "12"){ ?>selected<?php } ?>>jsp/asp</option>
        <option value="13" <?php if($weboption == "13"){ ?>selected<?php } ?>>html</option>
        <option value="14" <?php if($weboption == "14"){ ?>selected<?php } ?>>jQuery</option>
        <option value="15" <?php if($weboption == "15"){ ?>selected<?php } ?>>JavaScript</option>
        <option value="16" <?php if($weboption == "16"){ ?>selected<?php } ?>>기타</option>
      </select>
      </form>
      <?php } ?>
  </tr>
  <tr>
    <td class="write-ground">
      제목
    </td>
    <td class="td_padding">
      <input type="text" name="web_title" class="input">
    </td>
  </tr>
  <tr><td colspan="3" height="1" class="write-line"></td></tr>
  <tr>
    <td class="write-ground">
      이름
    </td>
    <td class="td_padding">
      <input type="text" name="web_name" class="input1">
    </td>
  </tr>
  <tr><td colspan="3" height="1" class="write-line"></td></tr>
  <tr>
    <td class="write-ground">
      비밀번호
    </td>
    <td class="td_padding">
      <input type="password" name="web_name" class="input2">
    </td>
  </tr>
  <tr><td colspan="3" height="1" class="write-line"></td></tr>
  <tr>
    <td class="write-ground">
      예상금액
    </td>
    <td class="td_padding">
      <input type="text" name="web_price" class="input2">
    </td>
  </tr>
  <tr><td colspan="3" height="1" class="write-line"></td></tr>
  <tr>
    <td class="write-ground">
      내용
    </td>
    <td class="td_padding">
      <textarea name="web_content" id="<%!=ASP %>" class="textarea"></textarea>
    </td>
  </tr>
  <tr class="write-ground">
    <td colspan="6" align="center">
      <button class="submit_button" onclick="aad()">
        <p class="write_button_submit">
          등록
        </p>
      </button>
    </td>
  </tr>
</table>

 

소스가 이런데요..

 

그 select 에다가도 전부 form 을 넣어줬는데

 

이제 등록을 누르면 글저장폼으로 이동해야하는데

 

form 을 밑에다가 써주면 select 내용은 못담아옵니다.

 

어떠가 폼을써줘야할까요 ㅠㅠ

이 질문에 댓글 쓰기 :

답변 1

흠...뭔가가 이상합니다.

 

== 기본적 체크사항 ==

제목,이름,비밀번호 등.. input 요소로 된부분은 form으로 안감싸져있네요.

select만을 form으로 감싼것 같은데... 이렇게 되면 제목,이름,비밀번호 등은 값이 안넘어올것 같군요.

또 혹시나 select 를 감싼 form밖에 또 form으로 감싸져있는지 체크해보시고요.

 

== 수정 소스 ==


<form action="<?php echo $PHP_SELF ?>" method="post" name="selbo" id="selbo">
   <input type="hidden" name="selectboard" value="<?php echo $selectboard ?>">
   <input type="hidden" name="weboption" value="<?php echo $weboption ?>">
 <table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
   <tr><td colspan="6" height="2" class="t_box_gray"></td></tr>
   <tr>
  <td class="write-ground td-width">
    카테고리
  </td>
  <td class="td_padding">
    <select name="selectboard" class="write-select" onchange="this.form.submit();">
   <option value="">선택해주세요</option>
   <option value="1" <?php if($selectboard == "1"){ ?>selected<?php } ?>>제작의뢰</option>
   <option value="2" <?php if($selectboard == "2"){ ?>selected<?php } ?>>Q&A</option>
   <option value="3" <?php if($selectboard == "3"){ ?>selected<?php } ?>>자유게시판</option>
   <option value="4" <?php if($selectboard == "4"){ ?>selected<?php } ?>>1:1 문의</option>
    </select>
    <?php if($selectboard == "1"){ ?>
     <select name="weboption" class="write-select" onchange="this.form.submit();">
    <option value="">선택해주세요</option>
    <option value="11" <?php if($weboption == "11"){ ?>selected<?php } ?>>제작의뢰</option>
    <option value="12" <?php if($weboption == "12"){ ?>selected<?php } ?>>부가수정</option>
    <option value="13" <?php if($weboption == "13"){ ?>selected<?php } ?>>리뉴얼</option>
     </select>
    <?php }elseif($selectboard == "2"){ ?>
     <select name="weboption" class="write-select" onchange="this.form.submit();">
    <option value="">선택해주세요</option>
    <option value="11" <?php if($weboption == "11"){ ?>selected<?php } ?>>php/mysql</option>
    <option value="12" <?php if($weboption == "12"){ ?>selected<?php } ?>>jsp/asp</option>
    <option value="13" <?php if($weboption == "13"){ ?>selected<?php } ?>>html</option>
    <option value="14" <?php if($weboption == "14"){ ?>selected<?php } ?>>jQuery</option>
    <option value="15" <?php if($weboption == "15"){ ?>selected<?php } ?>>JavaScript</option>
    <option value="16" <?php if($weboption == "16"){ ?>selected<?php } ?>>기타</option>
     </select>
    <?php } ?>
   </tr>
   <tr>
  <td class="write-ground">
    제목
  </td>
  <td class="td_padding">
    <input type="text" name="web_title" class="input">
  </td>
   </tr>
   <tr><td colspan="3" height="1" class="write-line"></td></tr>
   <tr>
  <td class="write-ground">
    이름
  </td>
  <td class="td_padding">
    <input type="text" name="web_name" class="input1">
  </td>
   </tr>
   <tr><td colspan="3" height="1" class="write-line"></td></tr>
   <tr>
  <td class="write-ground">
    비밀번호
  </td>
  <td class="td_padding">
    <input type="password" name="web_name" class="input2">
  </td>
   </tr>
   <tr><td colspan="3" height="1" class="write-line"></td></tr>
   <tr>
  <td class="write-ground">
    예상금액
  </td>
  <td class="td_padding">
    <input type="text" name="web_price" class="input2">
  </td>
   </tr>
   <tr><td colspan="3" height="1" class="write-line"></td></tr>
   <tr>
  <td class="write-ground">
    내용
  </td>
  <td class="td_padding">
    <textarea name="web_content" id="<%!=ASP %>" class="textarea"></textarea>
  </td>
   </tr>
   <tr class="write-ground">
  <td colspan="6" align="center">
    <button class="submit_button" onclick="aad(this.form);">
   <p class="write_button_submit">
     등록
   </p>
    </button>
  </td>
   </tr>
 </table>
</form>
<script>
 function aad(f){
 f.submit();
 }
</script>

 

답변을 작성하시기 전에 로그인 해주세요.
전체 152
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT