# Javascript terms and conditions help



## aconite (Feb 1, 2006)

hi,

I am trying to make the terms and conditions work with javascript but it doesn't seem to,.
This is what I want to happen, the customer clicks on a' Package' and before the customer can go to the cart page they must accept the terms and conditions.
This is the code

```
<SCRIPT LANGUAGE="JavaScript">
<!--

function SubmitForm(form)
{
    if (!document.getElementById('cust_agree').checked)
    {
        alert('To continue, you need to agree to the Terms and Conditions. Please select the appropriate checkbox.');
        return false;
	}
}

//-->
</SCRIPT>		

</head>

<body>
		
<p class="booking"><input type="checkbox" id="cust_agree" name="cust_agree" />&nbsp;I accept the <a href="terms.php">Terms and Conditions</a></p>	

<p>If you wish to place an order, please accept the <a href="terms.php">Terms and Conditions </a>by checking<br />
  the box.
```
I might as well kill two birds with one stone, the other question is that the arrow for checkout is not aligned next to the word 'checkout', I have checked to see what is wrong but can seem to figure out why it won't align

CSS
#cartBox {
background: url(../images/cartBox.jpg) no-repeat;
margin-left:80%;
font-size:1.1em;
padding-bottom:2px;
font-family:"Century Gothic";
height:99px;
width:108px;
}

.OrderShoppingCartText{
font-family: "Century Gothic";
color: #7E91A5;
font-size: 11px;
font-weight: normal;
}

.OrderShoppingCartText a{
color: #7E91A5;
text-decoration: none;
}

.arrowCheckout{
padding-bottom:19px;
}

.viewCart { /*inside cartBox on order page*/
padding-top:40px;
}

HTML

```
<div id="cartBox">
<span class="OrderShoppingCartText"><a href="cart.php">view cart <img src="../images/checkout_arrow.gif" class="viewCart" width="18" height="8" border="0"alt="" /></a></span>
<br />
<span class="OrderShoppingCartText"><a href="checkout.php">checkout<img src="../images/checkout_arrow.gif" class="arrowCheckout" width="18" height="8" border="0" alt="" /></a></span></div>
</div>
```
This is the link to the above 2 questions http://www.photorestorationexpert.co.uk/order/index.php

thanks


----------



## MMJ (Oct 15, 2006)

That javascript is a function, you must employ the function on an event or something.


----------

