Hi,

I am trying to do some tutorials in JavaScript and the following code has been given in the help document:

Code:
<SCRIPT>
function confirm(){
  var y = "Your address   ";
  
  y=y+order.address.value;

  y=y+"   Your toppings";

  if (document.order.chkolives.checked){
     y = y + " olives";
  }

  if (document.order.chkchick.checked){
     y = y + " spicy chicken";
  }

  if (document.order.chkspam.checked){
     y = y + " spam";
  }

  if (document.order.chkyuck.checked){
     y = y + " beetroot and mango YUCK!";
  }
if (document.order.chktyres.checked){
y=y+" Old Tyres And Razor blades, OUCH!";
}
  alert(y);
}
function finalise(){
  
  if (document.order.chkyuck.checked == 0){

    if (confirm ("why not try our half price beetroot and mango promotion?")){
      document.order.chkyuck.checked == 1;
     }

  }

}


</SCRIPT>

<BODY>
<FORM NAME="order">
<H1>Enter your address</H1>
<INPUT TYPE TEXT SIZE=80 NAME="address">
<P><P>
<H1>Choose your toppings</H1>
<INPUT TYPE="checkbox" NAME="chkolives">Olives
<P>
<INPUT TYPE="checkbox" NAME="chkchick">Spicy Chicken
<P>
<INPUT TYPE="checkbox" NAME="chkspam">Spam
<P>
<INPUT TYPE="checkbox" NAME="chkyuck">Beetroot and Mango
<P>
<input type="checkbox" name="chktyres">Old Tyres And Razor Blades<p><p>
<INPUT TYPE="button" VALUE="confirm order"
ONCLICK = confirm()>
<INPUT TYPE="button" VALUE="finalise"
ONCLICK = finalise()>

</BODY>
</HTML>
And the idea is that if the user does not select the Beetroot And Mango option when they click the Finalise button, it alerts them and if they click on OK, then the option is selected automatically. However, the coding given does not seem to work and I was wondering if there was a way of fixing it.

Thanks,

Andrew