ini script submit otomatis...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Test timer</title>
<?php session_start();?>
<script type="text/javascript">
var label =null;
Counter=5;
function onLoad()
{
label = document.getElementById("label1");
runTimer();
}
function runTimer()
{
label.innerHTML = Counter
Counter--;
if (Counter < 0)
{
var frmSoal = document.getElementById("frmSoal");
frmSoal.submit();
} else {
setTimeout(runTimer, 1000);
}
}
</script>
</head>
<body onload='onLoad();'>
<label id="label1"></label>
<form id="frmSoal" method="post" action="hasil.php">
<ul>
<li>
<p>Kepanjangan PHP adalah</p>
<p><label><input type="radio" name="soal1" value="a"/>PeeehaaaaPeee</label></p>
<p>
<label><input type="radio" name="soal1" value="b"/>Php Hypertext Protocol</label>
</p>
</li>
</ul>
<input type="submit" value="selesai"/>
</form>
</body>
</html>
Tidak ada komentar:
Posting Komentar
Komentar Anda di Modernisasi, Sampaikan dengan Cara Sopan dan Singkat.Terimakasih.