Back to Scripts page
Click in the box below, select all and copy to grab the script
<SCRIPT LANGUAGE="JavaScript"> <!-- Hide script from older browsers // This script copyright 1997, Tom Negrino and Dori Smith. // This script is from "JavaScript for the WWW, Visual QuickStart Guide, 2nd Ed." // For more information, see <http://www.chalcedony.com/javascript/>. // This script may be used and modified, but the copyright notice must remain intact. function submitIt(form) { // make sure they enter in a number of doors doorOption = -1 for (i=0; i<form.DoorCt.length; i++) { if (form.DoorCt[i].checked) doorOption = i } // can't have the sunroof with a four door if (form.DoorCt[doorOption].value == "fourDoor" && form.sunroof.checked) { alert("The sunroof is only available on the two door model") return false } // If we made it to here, everything's valid, so return true return true } // End hiding script --> </SCRIPT>