SilverRay SilverRay - 2 years ago 77
SQL Question

Codeigniter access input type inside echoed table

I have a table echoed inside from controller and loaded into a div id via jquery trigger event. The problem is that the table consists of input type texts that I made to datepickers but it's not working. Here is my code inside the controller:

echo "<table class='table table-striped table-borderless' width='100%'>
<td><label class='control-label'>AWOL</label></td>
<td><select class='form-control' id='cmbawol1' name='cmbawol1'>";
$awol_code = array();
$awol_code[] = $val['AWOL'];
echo "<option value='".$val['AWOL']."'>".$val['AWOL']."</option>";
foreach($data['offense'] as $value)
echo "<option value='".$value['Offense']."'>".$value['Offense']."</option>";
echo "</select></td>
<td><input type='text' class='form-control' id='txtawol1' name='txtawol1' value='".$date1."'/></td>

and this is the jQuery that I always use to create datepicker:


For other pages it works because they are not echoed inside the controller. Please note that this table is inside my edit function meaning it have a default value from my database.

I have the table structure with button on on the last column and I access it via this code:

............code goes here

But I don't know how for input types.

Answer Source

OK I solved y own problem and this is my solution:


I hope that others may find my code helpful too.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download