Hello all.
I am working to build my first full site, which happens to be a site for my clothing company.
I have a fairly strong working knowledge of PHP and HTML, and a decent grasp of Javascript.
What I'm trying to do is pass a variable for shirt sizes (contained in a dropdown select box) with PHP.
I have PHP generated pages for all of my shirts, and each contains the same dropdown:
PHP Code:
echo "<br><br><form action='cart.php?chk=add_to_cart&pid=";
echo $gRow['ID'];
echo "&size=";
echo "<script>document.write(size);</script>";
echo "' method='post' name=\"sizeform\"><select name=\"size\" onChange=\"_chkSize(this)\"><option value='1'>Small</option><option value='2'>Medium</option><option value='3'>Large</option></select>";
echo "<br /><br /><input type='image' name='Add to Cart' alt='Add to Cart' value='Add to Cart' src='/images/add.png'></form>";
This script calls _chkSize(), which is a javascript function, and is supposed to pass the size from the dropdown to the javascript variable "size".
Any advice you can give would be very helpful. I have programmed almost all of this site from scratch with ease, but this part is hanging me up.
I can provide any more information that may be needed, and I understand that this explanation was sub-par, but it was difficult to explain :P