0

how to make javascript validation onsubmit go first before onclick submit button

<form name="daftar" method="post" action="daftar.php" onsubmit="return checkscript()">

<input type="submit" name="Daftar" value="Daftar" id="submit" onClick="return tq()"/>

and my js:

function checkscript() {
if (document.daftar.terms.checked == false)
{ alert('Sila pastikan anda telah check ruangan persetujuan, untuk menandakan anda setuju dengan syarat-syarat kami.');
daftar.terms.focus();
return false ;
}
else return true;
}

function tq()
{
alert("Terima Kasih!");
}
2
Contributors
2
Replies
20
Views
4 Years
Discussion Span
Last Post by dina85
0
<form name="daftar" method="post" action="daftar.php" onsubmit="return tq()">

<input type="submit" name="Daftar" value="Daftar" id="submit" onClick="return checkscript()"/>

perhaps

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.