i’m editing a joomla website and in a form I needed to swap some dropdown select boxes with simple text fields. for example I swapped this:
<select name="date" id="date" class="date_tag">
<?php for($i=1;$i<=31;$i++) { ?>
<option value="<?php echo $i; ?>" <?php if($i == date('d')) echo 'selected="selected"'; ?>><?php echo $i; ?></option>
<?php } ?>
</select>
with that:
<input type="text" name="date" id="date" class="date_tag">
in the final proccessing of the form I can’t get the values of the fields I swapped from select
boxes to text fields.
although there are other text fields in this form. I can’t tell what’s different.
the processing is done with JRequest as in here:
if(JRequest::getInt('step', 0) == 2) {
global $mainframe;
$fstate = JRequest::getVar('fstate', '');
$fzip = JRequest::getVar('fzip', '');
$tstate = JRequest::getVar('tstate', '');
$tzip = JRequest::getVar('tzip', '');
$month = JRequest::getVar('month', '');
$date = JRequest::getVar('date', '');
$year = JRequest::getVar('year', '');
$weight = JRequest::getVar('weight', '');
$type = JRequest::getVar('type', '');
$first_name = JRequest::getVar('first_name', '');
$last_name = JRequest::getVar('last_name', '');
$email = JRequest::getVar('email', '');
$phone_type = JRequest::getVar('phone_type2', '');
$phone_num = JRequest::getVar('phone_num', '');
$time = JRequest::getVar('time2', '');
....
i get that $date=” even when I entered a value to that field.
as I said it worked before I made the swap.
what could be the problem?
thanks.
Sounds like there is something else going on here, as the new input field appears to be correct.
I would suggest using print_r($_POST) and tracing through the data.