I have now changed my code to this:
<script type="text/javascript" src="
/skin1/customer/popup_open.js"></script><script type="text/javascript" src="
/skin1/main/popup_image.js"></script><script type="text/javascript"><!--var PhoneObj = document.getElementById('additional_values_2');if (PhoneObj.length!=10 ){ alert('Please enter a phone number that is 10 digits long with no dashes "-".'); return false;}else return true;--></script>
I have moved the script to the suggested position in skin1/customer/main/register.tpl but it is still not validating the field. I have reviewed the code for the product.php page that uses javascript to validate the product options and there is one difference.
The field I want to validate is this:
<input type="text" name="additional_values[2]" id="additional_values_2" size="32" value="05135559999" />
and the code from the product page has this:
<select id="po3" name="product_options[3]" onchange="javascript
: check_options();">
How do I get the
onchange="javascript
: check_options(); into the register.tpl or register_additional_info.tpl?