Issues with my First calculation script

What happens when someone submits the form without the mouse, such as by pressing the enter key on one of the form fields.

Is there any reason why the onsubmit event of the form is not being used instead?

I have just tried using the onsubmit in lue of the onmousedown live on the net, and the form just submits regardless of the terms and conditions being selected, so its effectively ignored it. Should it be doing that ?

If its going to cause any issues Ill have to stick to onmousedown and just hope the user does not have a mouse… (I know that may sound a little complacent, but I dont think there`s any other way around it…)

Something you may not have known is that you normally tell the web browser to ignore the event by returning false from the function. Returning anything else (even nothing too) means that the browser continues to process that event as per normal.

No I didnt know that you could do that with feature. Thanks for the useful insight yet again… :slight_smile:

<form class=“orderEPC” action=“feedback.php” method=“post” onsubmit=“return validateForm()”>

Ended up removing the internal body JS as this was no longer needed and the external JS now reads :

function validateForm(){
if(tandc.value != “yes”){
alert(“Please make sure you have read and agreed to our terms and conditions”)
window.location.hash=“terms”;
return false;
}
}

Woohoo Ive actually finished, I seriously cannot thankyou enough Paul, youve really given me some sound advice and I do feel alot more confident in playing around with script now incomparison to 2 weeks ago :slight_smile:

Now wheres that Ferrari enzo I promised you ?.. :smiley: