Hi
No javascript expert here so just wondering if i could get some help of someone please.
im using a form to for an agreement page where the user either agrees or they disagree, if they disagree i simply want a message to say that there application can't be continued. however if they tick agree i want it to go to the next page.
at the moment it just goes to the next page no matter what you tick.
here is the code. any help would be appreciated!!
<SCRIPT LANGUAGE="javascript">
<!--
function check() {
g=document.declaration;
if(g.disagree.checked==true && g.agree.checked==true){
alert("You cant tick both boxes!");
} else if(g.disagree.checked==true){
alert("You can't proceed");
} else if(g.agree.checked==true) {
alert("You may proceed!");
} else {
alert("You havent ticked a box!")
}
}
//-->
</SCRIPT>
<!--Start of declaration form-->
<form name="declaration" action="applications.html">
<center>
<input type="checkbox" id="disagree" value=http://www.webdeveloper.com/forum/archive/index.php/"declaration" />Disagree
<input type="checkbox" id="agree" value="declaration" />I agree
</center>
<br>
<br>
<a href="applications.html" onClick="return check()">
<center><input type="submit" value="Begin" name="applications" align="right" >
</center>
</a>
</form>
No javascript expert here so just wondering if i could get some help of someone please.
im using a form to for an agreement page where the user either agrees or they disagree, if they disagree i simply want a message to say that there application can't be continued. however if they tick agree i want it to go to the next page.
at the moment it just goes to the next page no matter what you tick.
here is the code. any help would be appreciated!!
<SCRIPT LANGUAGE="javascript">
<!--
function check() {
g=document.declaration;
if(g.disagree.checked==true && g.agree.checked==true){
alert("You cant tick both boxes!");
} else if(g.disagree.checked==true){
alert("You can't proceed");
} else if(g.agree.checked==true) {
alert("You may proceed!");
} else {
alert("You havent ticked a box!")
}
}
//-->
</SCRIPT>
<!--Start of declaration form-->
<form name="declaration" action="applications.html">
<center>
<input type="checkbox" id="disagree" value=http://www.webdeveloper.com/forum/archive/index.php/"declaration" />Disagree
<input type="checkbox" id="agree" value="declaration" />I agree
</center>
<br>
<br>
<a href="applications.html" onClick="return check()">
<center><input type="submit" value="Begin" name="applications" align="right" >
</center>
</a>
</form>