CodeIgniter Forums
Table Custom - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Table Custom (/showthread.php?tid=76930)



Table Custom - gra - 07-04-2020

I would like to create a dynamic table with the edit and delete buttons.

PHP Code:
        $this->table->setheading(   'Product',
                                    'Description',
                                    'Number',
                                    'Actions'
                                    );

        foreach ($param as $key_TB => $value) {
    
    //second Buttons Delete
            $LAY_BT_Delete '<form action="FormDelete" method="POST">
                                    <input type="text" hidden name="id" value="'
.$value["id"].'">
                                    <button class="btn btn-danger" type="submit">
                                        Delete
                                    </button>
                                    </frorm>'
;
    
    // Close first button Change FormChange
            $LAY_BT_Change ='<button class="btn btn-primary" type="submit" >
                                                Change
                                            </button>
                                            </frorm>'
;
    
    //Data for form change                                        
            $this->table->addRow(   '<form action="FormChange" method="POST">'
                                    .'<input type="text"  class="form-control" maxlength="50" required name="name" value="'.$value["name"].'">'
                                    '<input type="text" class="form-control" maxlength="50" name="description" value="'.$value["description"].'">',
                                    $Number,
                                    $LAY_BT_Change.$LAY_BT_Delete);

        }
        return  $this->table->generate(); 
When he sees the first form open he closes it.
But without understanding the data to be sent.
And it doesn't allow me to generate the second submission form.

what solution can i use?

Thanks


RE: Table Custom - InsiteFX - 07-05-2020

You cannot use the forms in a table, you need to redirect to the form then back to your table.


RE: Table Custom - gra - 07-05-2020

(07-05-2020, 03:30 AM)InsiteFX Wrote: You cannot use the forms in a table, you need to redirect to the form then back to your table.


Can't I insert submit and form buttons in the table?



How can you modify the data of a table?


RE: Table Custom - inumaru - 07-05-2020

Your closing tag is wrong maybe try to correct it.

you type
Code:
</frorm>

should be
Code:
</form>

and try to close all the form tag correctly, if the form is inside <td> it should be okay.


RE: Table Custom - gra - 07-05-2020

(07-05-2020, 08:07 AM)inumaru Wrote: Your closing tag is wrong maybe try to correct it.

you type
Code:
</frorm>

should be
Code:
</form>

and try to close all the form tag correctly, if the form is inside <td> it should be okay.

I do not believe it....
The autocompletion of the ide ....
Thank you
Sorry for the distraction ....