View Single Post
  #6  
Old 10-23-2007, 03:02 PM
 
TL408 TL408 is offline
 

X-Adept
  
Join Date: Jan 2005
Posts: 549
 

Default Re: Javascript Validation for Product Options

Hi Carpeperdiem,

I notice in the "Validation Javascript" below, you have two production option lines listed. If my item have only one product option group, should I remove the second line? Or change the production option to the same PO number on both lines?

For example, in one of my item with only 1 product option and the product option number is 500. Should I have the "Validation Javascript" to look like this instead?

--------------------------------------------------------------------------------------------------------------------------
if (document.getElementById('po500').selectedIndex == 0)
{ alert('Please select a size for your item.'); return false;
}
else return true;
--------------------------------------------------------------------------------------------------------------------------

Thank you
-Tuan



Quote:
Originally Posted by carpeperdiem
THEN -- in the product options javascript, use something like this:

Code:
if (document.getElementById('po17').selectedIndex == 0) { alert('Please select...'); return false; } if (document.getElementById('po18').selectedIndex == 0) { alert('Please select...'); return false; } else return true;

and of course, change the 'po' in the js to the actual product option number.
__________________
Win2003 IIS6, PHP 5.2.3, MySQL 5.0.45 and X-Cart 4.1.9
Reply With Quote