<select name="betrag" id="guitatype" onchange="test();">
<?PHP
foreach($pscBetraege as $pscs) {
echo'<option value="'.$pscs.'">'.$pscs.'</option>';
}
?>
<script type="text/javascript">
function test(){
if (document.getElementById("guitatype").value = "Paypal";) {
window.location.replace("http://stackoverflow.com");
}
}
</script>
</select>
select id = "guitatype"값이 "PayPal"로 변경되면 사이트가 사용자를 ex : stackoverflow.com으로 리디렉션하지만 그 스크립트는 ' 일하지 마라.PHP 자바 스크립트 - 셀렉트가 변경되었을 때 리디렉션
닫기 선택 태그 – mithunsatheesh
값을 확인하는 곳은 == 아닙니다 =입니다. –
@ coderboi_89 주석에 코드를 덤프하지 마십시오. –