ajax질문요 채택완료
$(document).ready(function() {
$("#statusFilter").change(function() {
$("#container").load("money.php", { num: $(this).val()},
function() {
});
});
});
option value="">
위에 처럼 셀렉트가 1개일 경우 정상적으로 잘 돌아갑니다.
아래처럼 2개일 경우 2개 값을 동시에 넘기려면 어떻게 해야 하나요?
option value=""> "class="frm_input" id="statusFilter"> option value="">
<container"">
답변 1개
1. select num2 의 id 를 statusFilter2 로 변경
2. div id container2 추가
3.
</span></p><p><span style="font-size: 10pt; line-height: 1.5;"></span><span style="font-family: gulim, helvetica; font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><script type="text/javascript"></span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);"> $(document).ready(function() {</span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);"> $("#statusFilter").change(function() { </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);"> $("#container").load("money.php", { num: $(this).val()}, </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="white-space: pre; color: rgb(0, 0, 0);"> </span><span class="Apple-tab-span" style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; white-space: pre; color: rgb(0, 0, 0);"> </span><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0);"> </span><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0);"> function() {</span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0);"> });</span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);"> });</span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0);"> $("#statusFilter2").change(function() { </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);"> $("#container2").load("money.php", { num: $(this).val()}, </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="white-space: pre; color: rgb(0, 0, 0);"> </span><span class="Apple-tab-span" style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; white-space: pre; color: rgb(0, 0, 0);"> </span><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0);"> </span><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0);"> function() {</span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0);"> });</span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0);"> });</span><span style="color: rgb(0, 0, 0);"> </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);"> });</span></p><p><span style="font-family: gulim, helvetica; font-size: 13.0799999237061px; line-height: 23.5440006256104px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"></script></span><span style="font-size: 10pt; line-height: 1.5; color: rgb(0, 0, 0);"> </span></p><p><span style="font-size: 10pt; line-height: 1.5; color: rgb(0, 0, 0);">
로 변경
</span></p><p><span style="font-size: 13.3333330154419px; line-height: 1.5; font-family: gulim, helvetica; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><div></span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 13.3333330154419px; line-height: 1.5; color: rgb(0, 0, 0);"> </span><span style="font-size: 13.3333330154419px; line-height: 1.8em; color: rgb(0, 0, 0);"><select name="</span><span style="font-size: 13.3333330154419px; line-height: 1.8em; color: rgb(0, 0, 0);">num"</span><span style="font-size: 13.3333330154419px; line-height: 1.8em; color: rgb(0, 0, 0);">class="frm_input" id="statusFilter"></span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="font-size: 13.3333330154419px; line-height: 1.5; white-space: pre; color: rgb(0, 0, 0);">option value=""> </option></span><span style="font-size: 13.3333330154419px; line-height: 1.5; color: rgb(0, 0, 0);"></select><div id="</span><span style="color: rgb(0, 0, 0); font-size: 13.0799999237061px; line-height: 23.5440006256104px;">container"></div></span><span style="font-size: 13.3333330154419px; line-height: 1.5; color: rgb(0, 0, 0);"></span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 13.3333330154419px; line-height: 1.5; color: rgb(0, 0, 0);"> <select name="<span style="color: rgb(0, 0, 0);">num2</span>"class="frm_input" id="statusFilter2"></span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="font-size: 13.3333330154419px; line-height: 1.5; white-space: pre; color: rgb(0, 0, 0);">option value=""> </option></span><span style="font-size: 13.3333330154419px; line-height: 1.5; color: rgb(0, 0, 0);"></select><div id="</span><span style="color: rgb(0, 0, 0); font-size: 13.0799999237061px; line-height: 23.5440006256104px;">container2"></div></span><span style="font-size: 13.3333330154419px; line-height: 1.5; color: rgb(0, 0, 0);"></span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="font-size: 13.3333330154419px; line-height: 1.5; white-space: pre; color: rgb(0, 0, 0);"></div></span><span style="font-size: 10pt; line-height: 1.5; color: rgb(0, 0, 0);"></span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 10pt; line-height: 1.5; color: rgb(0, 0, 0);">
답변에 대한 댓글 3개
현재 값을 php 변수에 기입하여 요청하는 방법이 있습니다.
ex )
$num = '1';
$num = '2';
$("#statusFilter").change(function() {
$("#container").load("money.php", { num: $(this).val(), num2: <?php echo $num2; ?>},
function() {
});
});
엄청 누락해서 적었는데, select 에서 해당 변수와 같은 값이면 selected 해주시면 되겠죠..
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인