체크박스 체크 시 2개의 input 값으로 보내주려면 어떻게 해야할까요?
</p>
<p> <section class="margin-top-10">
<label class="select">
<select name="sfl" id="sfl" class="form-control">
<option value="wr_subject"<?php get_selected($sfl, 'wr_subject', true); ?>>제목</option>
<option value="wr_content"<?php get_selected($sfl, 'wr_content'); ?>>내용</option>
<option value="wr_subject||wr_content"<?php get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option>
<option value="mb_id,1"<?php get_selected($sfl, 'mb_id,1'); ?>>회원아이디</option>
<option value="mb_id,0"<?php get_selected($sfl, 'mb_id,0'); ?>>회원아이디(코)</option>
<option value="wr_name,1"<?php get_selected($sfl, 'wr_name,1'); ?>>글쓴이</option>
<option value="wr_name,0"<?php get_selected($sfl, 'wr_name,0'); ?>>글쓴이(코)</option>
<?php if (is_array($ex_sfl)) { ?>
<?php foreach ($ex_sfl as $key => $ex_name) { ?>
<option value="<?php echo $key; ?>"<?php get_selected($sfl, $key, true); ?>><?php echo $ex_name; ?></option>
<?php } ?>
<?php } ?>
</select>
<i></i>
</label>
</section>
<section>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<div class="input input-button">
<input type="text" name="stx" value="<?php get_selected($sfl, $key); ?>" id="stx">
<div class="button"><input type="submit" value="검색">검색</div>
</div>
</section></p>
<p>
이윰빌더를 사용해서 게시판을 제작중인데, 검색 부분이 저런식으로 셀렉트박스에서 sfl 값을 선택 후
검색어 stx 를 입력 하는것 같거든요.
예를들어
</p>
<p><input type="checkbox" id="ex_1" name='ex_1' value=""><i></i>체크홍길동</p>
<p>
위 체크박스 체크 시 저 sfl 이랑 stx의 값이 둘다 "체크홍길동" 으로 받을수 있게 하고 싶은데 도움좀 부탁드립니다!
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
2년 전
</p>
<p>$('#ex_1').change(function() {</p>
<p> $('input[name=sfl], input[name=stx]').value = this.checked ? this.value : '';</p>
<p>});</p>
<p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
2년 전
window.onload = function(){
var checkbox = document.querySelector("input[name=ex_1]");
checkbox.addEventListener('change', function() { if (this.checked) {
let element = document.getElementById( "sfl" );
element.value = "wr_name,1";
document.getElementById("stx").value = "홍길동";
} else { //console.log("Checkbox is not checked.."); } });
}
이런 걸 원하시는 건가 모르겠네요.
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
채택
채택
답변대기
답변대기
채택
채택
채택
채택
채택
채택
채택
채택
답변대기
채택
답변대기
답변대기
채택
채택
답변대기
채택