확인란을 선택했을 때만 양식을 제출하거나 "확인란을 선택하십시오"라고 표시하고 싶습니다. 그렇게 할 방법이 있습니까? 아무도 나를 안내 할 수 있습니까?확인란을 선택했을 때 양식을 제출하는 방법은 무엇입니까?
감사
<form name="myForm" action="mailsent.php" method="post">
<input type="checkbox" class="chk_row" name="chk1[]"" value=" '.$rows["id"].'"/>
<input type="submit" value="" style="margin:7px 26px -27px 1424px;background-image: url(/image/exporttt.png);background-repeat: no-repeat;cursor:pointer;" >
</form>
편집 코드 : JQuery와
를 사용
<form name="myForm" action="mailsent.php" method="post">
<input type="checkbox" class="chk_row" id="chk1" name="chk1[]"" value=" '.$rows["id"].'"/>
<input type="submit" value="" style="margin:7px 26px -27px 1424px;background-image: url(/image/exporttt.png);background-repeat: no-repeat;cursor:pointer;" >
</form>
<script>
$('form').submit(function(){
if(!$('#chk1').is(':checked')){
alert("Please Check ");
return false;
}
});
</script>
먼저 직접 시도해야합니다. –
가능한 [체크 박스가 체크되어있을 때 양식을 제출하는] 중복 (0120)을 참조하십시오. – Rikesh
질문 제목은 다음과 같습니다. 잘못된. 나는 확인란을 클릭 할 때 양식을 제출해야하므로 그것을 읽습니다. – RRikesh