여분필드 사용방법 질문입니다

여분필드 사용방법 질문입니다

QA

여분필드 사용방법 질문입니다

본문

<div class="form-group">
            <label class="col-sm-2 col-xs-12 control-label" for="entry_point">참가</label>
            <div class="col-sm-3 col-xs-6">
                <div class="control-label input-group input-group-sm">
                <span class="input-group-addon">CFG scale</span>
                    <textarea name="wr_4" id="wr_4" rows="3" class="form-control input-sm" maxlength="500""><?php echo $write['wr_4']; ?></textarea>
                    
                </div>    
            </div>

 

이런식의 여분필드는 작성, 불러오기가 잘 되는데

 

    <div class="col-sm-3 col-xs-6">
                <div class="control-label input-group input-group-sm">
                <span class="input-group-addon">Sampler</span>
                    <select name="type" id="type" class="form-control input-sm"> <?php echo $write['wr_3']; ?>
                    
                        <option value="1"<?php echo get_selected("1", $type);?>>euler a</option>
                        <option value="2"<?php echo get_selected("2", $type);?>>euler</option>
                        <option value="3"<?php echo get_selected("3", $type);?>>DPM++ 2S a</option>
                        <option value="4"<?php echo get_selected("4", $type);?>>DPM++ 2M</option>
                        <option value="5"<?php echo get_selected("5", $type);?>>DPM++ SDE</option>
                        <option value="6"<?php echo get_selected("6", $type);?>>DPM++ 2S a Karras</option>
                        <option value="7"<?php echo get_selected("7", $type);?>>DPM++ 2M Karras</option>
                        <option value="8"<?php echo get_selected("8", $type);?>>DPM++ SDE Karras</option>
                        <option value="9"<?php echo get_selected("8", $type);?>>DDIM</option>
                    </select>
                    
                </div>    
            </div>
            
        </div>

 

이런식으로 셀렉같은 경우 작동이 되지 않네요...

wr_3을 적용시키려면 어떻게 하면 될까요 ㅠㅠ?

이 질문에 댓글 쓰기 :

답변 1

셀렉트 뒤에 wr_3이 왜 있는지는 잘 모르겠네요 $type을 wr_3 으로 바꿔보세요

<option value="1"<?php echo get_selected("1", $wr_3);?>>euler a</option>
<option value="2"<?php echo get_selected("2", $wr_3);?>>euler</option>
<option value="3"<?php echo get_selected("3", $wr_3);?>>DPM++ 2S a</option>
<option value="4"<?php echo get_selected("4", $wr_3);?>>DPM++ 2M</option>
<option value="5"<?php echo get_selected("5", $wr_3);?>>DPM++ SDE</option>
<option value="6"<?php echo get_selected("6", $wr_3);?>>DPM++ 2S a Karras</option>
<option value="7"<?php echo get_selected("7", $wr_3);?>>DPM++ 2M Karras</option>
<option value="8"<?php echo get_selected("8", $wr_3);?>>DPM++ SDE Karras</option>
<option value="9"<?php echo get_selected("8", $wr_3);?>>DDIM</option>

이런식으로 바꿔봤는데 출력이 되질 않네요... $ 때고 wr_3만 넣으면 오류가 나구요.,..

<option value="euler a"<?php echo get_selected("1", $type);?>>euler a</option>
<option value="euler"<?php echo get_selected("2", $type);?>>euler</option>
<option value="DPM++ 2S a"<?php echo get_selected("3", $type);?>>DPM++ 2S a</option>
<option value="DPM++ 2M"<?php echo get_selected("4", $type);?>>DPM++ 2M</option>
<option value="DPM++ SDE"<?php echo get_selected("5", $type);?>>DPM++ SDE</option>
<option value="DPM++ 2S a Karras"<?php echo get_selected("6", $type);?>>DPM++ 2S a Karras</option>
<option value="DPM++ 2M Karras"<?php echo get_selected("7", $type);?>>DPM++ 2M Karras</option>
<option value="DPM++ SDE Karras"<?php echo get_selected("8", $type);?>>DPM++ SDE Karras</option>
<option value="DDIM"<?php echo get_selected("8", $type);?>>DDIM</option>

이렇게 하니 됐네요 감사합니다!

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

회원로그인

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