[eluser]Unknown[/eluser]
I have created a registration page where some combo field available. For example for data of birth data,month,year has different like this
Code:
<td>Date of Birth</td>
<td>
<div id='date'>
<select name='sday' class='day' style='width:45px'>
<?php for($i=1;$i<=31;$i++)
echo "<option value='$i' ".set_select('sday', $i)." >".$i."</option>";
echo "</select><select name='smonth' style='width:105px' class='mon'>";
$monthName = array(1=> "January", "February", "March","April", "May", "June", "July","August", "September", "October","November", "December");
for($i=1;$i<=12;$i++)
echo "<option value='$i' ".set_select('smonth', $i)." >".$monthName[$i]."</option>";
echo "</select><select name='syear' style='width:58px' class='year'>";
$today=Time();
$dt=date("Y", $today);
for($i=$dt-11;$i>=$dt-45;$i--)
echo "<option ".set_select('syear', $i)." >".$i."</option>";
echo "</select><br />";
?></td>
when user will miss some value in registration page this page will again show. For this purpose I used these kinds of coding below which works good.
Code:
$this->form_validation->_field_data['firstname']'postdata']=$this->input->post('firstname');
$this->form_validation->_field_data['lastname']'postdata']=$this->input->post('lastname');
But my question what can I do for the combo field when user will miss data and same page will show with the previous value.I am facing problem because here in combo field here is data and id also.Because the id field have to insert only database.