I have php code that I am using on submit of a registration form that passes the number of checked "check boxes" counted for each array to a shopping cart as a product quantity.
I want to modify that code to pass the value of "input textboxes" (for products where more than one can be purchased) for another array. right now no matter if 3 or 4 or 2 is typed into the form only 1 is being passed to the shopping cart.
This is what works using check boxes. What should I change to use text input boxes?
Thank you
I want to modify that code to pass the value of "input textboxes" (for products where more than one can be purchased) for another array. right now no matter if 3 or 4 or 2 is typed into the form only 1 is being passed to the shopping cart.
This is what works using check boxes. What should I change to use text input boxes?
Code:
$debug = false;
$bqtyd_array = $bqtyw_array = $fqtyd_array = $fqtyw_array = $tentm_array = array();
for ( $i = 0; $i <=5; $i++ ) {
$bqtyd_array[$i] = JRequest::getBool('bqtyd'.$i, 'false', 'post');
$bqtyw_array[$i] = JRequest::getBool('bqtyw'.$i, 'false', 'post');
$fqtyd_array[$i] = JRequest::getBool('fqtyd'.$i, 'false', 'post');
$fqtyw_array[$i] = JRequest::getBool('fqtyw'.$i, 'false', 'post');
}
for ( $n = 0; $n <=5; $n++ ) {
$tentm_array[$n] = JRequest::getBool('tentm'.$n, 'false', 'post');
}
if ($debug) {echo '<div>$tentm_array: '.print_r($tentm_array, true).'</div>';}
$count['bsd'] = array_sum($bqtyd_array);
$count['bsw'] = array_sum($bqtyw_array);
$count['fcd'] = array_sum($fqtyd_array);
$count['fcw'] = array_sum($fqtyw_array);
$count['jrtm'] = array_sum($tentm_array);
Comment