Hi I've seen several problems with people getting blank data from check boxes, I see fixes like:
This works for me in my emails, I get results even if the check boxes were not used.
My problem is that i need to check the check boxes and drop down select boxes to see if people qualify to be registered to my joomla site.
Can someone please post some examples of how to read checkbox arrays and dropdown selections,
I have tried:
1)
v = check? the field name
temp[0] = Yes or blank
k = index 0, 1, 2, 3, etc
how do i read the details when the checkbox is blank, somehow the email is able to do i, but I can't, can someone help please?
Once I can put the data into a variable I should be fine, I can do it with normal html, but i don't get the
<?php
// substitute the values from the array for any missing values from the form$check_array = array(
'check0' => '0',
'check1' => '0'
);
foreach ( $check_array as $k => $v ) {
$temp = JRequest::getString($k, $v, 'post');
JRequest::setVar($k, $temp);
}
?>
This works for me in my emails, I get results even if the check boxes were not used.
My problem is that i need to check the check boxes and drop down select boxes to see if people qualify to be registered to my joomla site.
Can someone please post some examples of how to read checkbox arrays and dropdown selections,
I have tried:
1)
$checkbox_array = array(
'check0',
'check1'
);
foreach ( $checkbox_array as $k => $v ) {
$temp = JRequest::getVar($v, '', 'post');
echo $v." -- ". $temp[0]. " -- ". $k. "<br />";
}
v = check? the field name
temp[0] = Yes or blank
k = index 0, 1, 2, 3, etc
how do i read the details when the checkbox is blank, somehow the email is able to do i, but I can't, can someone help please?
Once I can put the data into a variable I should be fine, I can do it with normal html, but i don't get the
JRequest::getString($k, $v, 'post');
syntax, is there somewhere that explains it?