View Single Post
  #2  
Old 03-17-2010, 07:22 PM
  McPace's Avatar 
McPace McPace is offline
 

Member
  
Join Date: Sep 2008
Posts: 26
 

Angry Re: Need help with options script

OK I think the problem is in checking two elements in one if statement, b/c if I start with

Code:
if (document.getElementById('po1701').selectedIndex == 0) { alert('Please select the size of your artwork.'); return false; } if (document.getElementById('po1746').selectedIndex == 0) { alert('Please select a frame style for your artwork.'); return false; } else return true;

They both work fine.
Now if I add the two variable if statement it doesn't add to cart, the function works, but it never adds to cart.

Code:
if (document.getElementById('po1701').selectedIndex == 0) { alert('Please select the size of your artwork.'); return false; } if (document.getElementById('po1701').selectedIndex == 1 && document.getElementById('po1746').selectedIndex != 0 ) { alert('The smallest size of this image does not come framed, please un-select a frame option and try again. See our FAQ page for more information.'); return false; } if (document.getElementById('po1746').selectedIndex == 0) { alert('Please select a frame style for your artwork.'); return false; } else return true;

I'm gonna have to figure out what's up since I want two statements that check multiple values
__________________
McPace
4.1.12
Reply With Quote