View Single Post
  #1  
Old 09-21-2009, 04:47 PM
  Cyber Matrix's Avatar 
Cyber Matrix Cyber Matrix is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 199
 

Default Validation script (Javascript)

I'm using the validation box that is under the product options of the admin. However, is there way to put this in a tpl without having to put this for each product that needs it.

Code:
if (product_option('Hose Media').value == '') { alert('Please complete Hose Media (Ex. Water, Steam, etc.)'); return false; } if (product_option('Hose Working Pressure (PSI)').value == '') { alert('Please complete Hose Working Pressure (PSI)'); return false; } if (product_option('Hose Operating Temperature (F)').value == '') { alert('Please complete Hose Operating Temperature (F)'); return false; } if (document.getElementById('po454').selectedIndex == 0) { alert('Please select your 1st Fititng.'); return false; } if (document.getElementById('po455').selectedIndex == 0) { alert('Please select your 2nd Fititng.'); return false; } else return true;

By the way this is for a 4.2 cart
__________________
Cyber Matrix
-------------------
X-Cart 4.1.9
Reply With Quote