View Single Post
  #4  
Old 12-13-2011, 06:35 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Validate Product options??

Used this. Also put it in a separate JS file so it would be global.

Code:
function validate_form(){ if (document.orderform[4].selectedIndex=='0') { alert('Please select whether you would like to use New Measurements or My Measurements.'); return false; } else if(document.orderform[4].selectedIndex=='1') { var elem = (document.orderform.elements); var nelem = (elem.length*1) - (3*1); for(var i = 0; i < nelem; i++) { if(document.orderform[i].type=='select-one') { if(document.orderform[i].selectedIndex=='0') { alert('Please select all options.'); return false; } } } } else return true; }
__________________
xcart 5.1.2
Reply With Quote