Welcome Guest, Not a member yet? Register   Sign In
How to set old() to the dropdown menu ?
#3

(This post was last modified: 09-05-2023, 12:15 AM by sknair143.)

(09-04-2023, 11:27 PM)sammyskills Wrote: You will need to use the set_select() form helper. See docs

PS: If you are using any of the form_open() helpers (form_open, form_open_multipart), you do not need to use old(). Use set_value() instead.

Thanks. I'm using form helper but i tried this , but not working

PHP Code:
<select id="defaultSelect" name="nationality_id" class="form-select">
                                    <option value="">Select</option>

                                    <?php foreach ($nationalities as $nation): ?>
                                        <option value="<?= $nation['id'?><?= set_select('nationality_id'?>><?= $nation['name'?></option>
                                    <?php endforeach; ?>
                                </select> 
Reply


Messages In This Thread
RE: How to set old() to the dropdown menu ? - by sknair143 - 09-05-2023, 12:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB