Passing a value from a dynamic select box
Posted: Mon Apr 03, 2006 11:24 am
Hi I hope someone can help me out,
I have a field in my tbl_skuoptions and have called this 'embro' and in the table I have the following:
Option Name embro
6 inches 1
8 inches 1
10 inches 1
6 inches embroidery 2
8 inches embroidery 2
10 inches embroidery 2
When a selection above is made from my dynamic 'Select Box' I need to pass this ‘embro’ value i.e. 6 inches - embro value = 1 etc, to an 'if statement' on another page. What I'm stuck on is trying to work out how to get the value from the ‘select option’ code and how to query the database i.e. Select * from blah and blah Where blah etc. If anyone can help me out as I’m not experienced enough to follow all of this code as I’m trying to implement and tweak this to customise a page for myself.
I’m sure the bit of code I need to work on is the following (below) however the full page can be found here http://www.ahamay.com/helpp.php with this section highlighted and I appreciate it’s a large piece of code and that’s why I’m not posting it all here on the forum but I feel it might help my cause if it’s available in full should anyone wish to view it.
Thank you very much and I do appreciate any suggestions at all.
I have a field in my tbl_skuoptions and have called this 'embro' and in the table I have the following:
Option Name embro
6 inches 1
8 inches 1
10 inches 1
6 inches embroidery 2
8 inches embroidery 2
10 inches embroidery 2
When a selection above is made from my dynamic 'Select Box' I need to pass this ‘embro’ value i.e. 6 inches - embro value = 1 etc, to an 'if statement' on another page. What I'm stuck on is trying to work out how to get the value from the ‘select option’ code and how to query the database i.e. Select * from blah and blah Where blah etc. If anyone can help me out as I’m not experienced enough to follow all of this code as I’m trying to implement and tweak this to customise a page for myself.
I’m sure the bit of code I need to work on is the following (below) however the full page can be found here http://www.ahamay.com/helpp.php with this section highlighted and I appreciate it’s a large piece of code and that’s why I’m not posting it all here on the forum but I feel it might help my cause if it’s available in full should anyone wish to view it.
Thank you very much and I do appreciate any suggestions at all.
Code: Select all
if ($displayType == "Advanced"){
$query_rsCWParentQuery = "SELECT S.SKU_ID,
O.option_ID,
O.option_Name,
O.option_Sort
FROM tbl_skuoptions O
INNER JOIN tbl_skuoption_rel SO
ON O.option_ID = SO.optn_rel_Option_ID
INNER JOIN tbl_skus S
ON S.SKU_ID = SO.optn_rel_SKU_ID
WHERE S.SKU_ShowWeb = 1
AND S.SKU_ProductID = ". $productId;
if($cartweaver->settings->allowBackOrders == 0) {
$query_rsCWParentQuery .= " AND S.SKU_Stock <> 0 ";
}
$query_rsCWParentQuery .= " ORDER BY O.option_Sort";
$rsCWParentQuery = $cartweaver->db->executeQuery($query_rsCWParentQuery);
$rsCWParentQuery_recordCount = $cartweaver->db->recordCount;
//$row_rsCWParentQuery = $cartweaver->db->db_fetch_assoc($rsCWParentQuery);
echo("<script language=\"JavaScript\" src=\"cw2/assets/scripts/dropdowns.js\"></script>
<script language=\"JavaScript\">
var arrDynaList = new Array();
var arrDL1 = new Array();\r\n");
$currentRow = 0;
$lastTFM_nest = "";
$intFieldCounter=1;
foreach ($rsCWAllOptions as $key => $row_rsCWAllOptions){
$currentRow++;
$tfm_nest = $row_rsCWAllOptions['optiontype_Name'];
if ($lastTFM_nest != $tfm_nest) {
$lastTFM_nest = $tfm_nest;
echo("arrDL1[" . $intFieldCounter++ . "] = \"sel" . $currentRow . "\";\r\n");
echo("arrDL1[" . $intFieldCounter++ . "] = \"addToCart\";\r\n");
}//End of Simulated Nested Repeat
}