Welcome Guest, Not a member yet? Register   Sign In
Update Multiple checkbox if it checked or not
#2

cant tell you for checkbox but the logic (at least for CI4.2.6) is similar to choice from a drop down.

the way I do update is to get current data from a database and populate it into a form, if there is text to update.


IN a form I also have a drop down
Code:
    <select id="category" name="category">
            
            <option value="Blog">Blog</option>
            <option value="Issue">Issue</option>
                    
                    </select>
In my database I have a feild called category, the choice makes a diffrence when i want to select data as to whether its a sort of full blog, that needs a certain view, or if its a sort of news item , which uses a diffrent view

in a controller i get choice by user:

Code:
$category=  $this->request->getVar('category');

I then use that to update db.

checkbox and updating is going to be similar.
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply


Messages In This Thread
RE: Update Multiple checkbox if it checked or not - by captain-sensible - 10-08-2022, 03:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB