Welcome Guest, Not a member yet? Register   Sign In
Read table values
#1

[eluser]GrootBaas[/eluser]
Hi there,

I have the following table. And I need to save the user input to the database.

How can I do this….

I have used jQuery DB class.

Code:
var arr_value = new Array( $($('.odo').select('.prvt_days'))[0][0], $($('.odo').select('.prvt_days'))[0][1], $($('.odo').select('.prvt_days'))[0][2] );
      
alert('array '+arr_value)
document.save_logs.table.value = arr_value;

Works great for all the values except the form input values. Which is the ones I need.

Any help will be much appreciated, as my head is going to roll.


Code:
echo "<table class=\"odo\" width=\"100%\">\n";
      
     while ($veh_det = oci_fetch_assoc($veh_details)) {
      
           echo "<tr>\n";
                echo   "<td class=\"period\" width=\"12%\" style=\"padding: 2px;\">\n";
                    echo $veh_det['PERIOD'];
              echo "</td>\n";
                echo "<td class=\"start_odo\" width=\"12%\" style=\"padding: 2px;\">\n";
                     echo $veh_det['START_ODO'];
                echo "</td>\n";
                echo   "<td class=\"end_odo\" width=\"12%\" style=\"padding: 2px;\">\n";
                     echo form_input(array('name'=>'log_end_odo',
                                           'id'=>'log_end_odo',
                                      'maxlength'=>'20',
                                           'size'=>'20',
                                        'value'=> $veh_det['END_ODO']),1);
                    
                echo "</td>\n";
                echo   "<td class=\"prvt_km\" width=\"12%\" style=\"padding: 2px;\">\n";
                     echo form_input(array('name'=>'prvt_km',
                                           'id'=>'prvt_km',
                                    'maxlength'=>'20',
                                           'size'=>'20',
                                        'value'=> $veh_det['PRVT_KM']),2);
                echo "</td>\n";
                echo   "<td class=\"prvt_days\" width=\"12%\" style=\"padding: 2px;\">\n";
                     echo form_input(array('name'=>'prvt_days',
                                           'id'=>'prvt_days',
                                    'maxlength'=>'20',
                                            'size'=>'20',
                                        'value'=> $veh_det['PRVT_DAYS']),3);
     }  
    
     echo "</table>";
#2

[eluser]GrootBaas[/eluser]
Reading the table fields I can do, but as soon as the <TD> element contains a input field, I am unable to read the cell value.

Is there any other way of doing this?
#3

[eluser]dcunited08[/eluser]
I am rather confused about where you are, do you call form_open anywhere? I don't see where the actual form is in your page. No form, no values. Secondly, you may look at using the CI Oracle driver instead of mixing database function calls with your view (goes against MVC). Thirdly, what exactly are you attempting to accomplish with the JavaScript code?




Theme © iAndrew 2016 - Forum software by © MyBB