<small id='98Fdu'></small><noframes id='98Fdu'>

      <bdo id='98Fdu'></bdo><ul id='98Fdu'></ul>
    1. <i id='98Fdu'><tr id='98Fdu'><dt id='98Fdu'><q id='98Fdu'><span id='98Fdu'><b id='98Fdu'><form id='98Fdu'><ins id='98Fdu'></ins><ul id='98Fdu'></ul><sub id='98Fdu'></sub></form><legend id='98Fdu'></legend><bdo id='98Fdu'><pre id='98Fdu'><center id='98Fdu'></center></pre></bdo></b><th id='98Fdu'></th></span></q></dt></tr></i><div id='98Fdu'><tfoot id='98Fdu'></tfoot><dl id='98Fdu'><fieldset id='98Fdu'></fieldset></dl></div>
      <legend id='98Fdu'><style id='98Fdu'><dir id='98Fdu'><q id='98Fdu'></q></dir></style></legend>
      <tfoot id='98Fdu'></tfoot>

    2. CodeIgniter select_value in form_dropdown

      时间:2023-10-03

        <tbody id='h3npE'></tbody>
      • <legend id='h3npE'><style id='h3npE'><dir id='h3npE'><q id='h3npE'></q></dir></style></legend>

            <bdo id='h3npE'></bdo><ul id='h3npE'></ul>
          • <i id='h3npE'><tr id='h3npE'><dt id='h3npE'><q id='h3npE'><span id='h3npE'><b id='h3npE'><form id='h3npE'><ins id='h3npE'></ins><ul id='h3npE'></ul><sub id='h3npE'></sub></form><legend id='h3npE'></legend><bdo id='h3npE'><pre id='h3npE'><center id='h3npE'></center></pre></bdo></b><th id='h3npE'></th></span></q></dt></tr></i><div id='h3npE'><tfoot id='h3npE'></tfoot><dl id='h3npE'><fieldset id='h3npE'></fieldset></dl></div>

            <small id='h3npE'></small><noframes id='h3npE'>

              • <tfoot id='h3npE'></tfoot>
                本文介绍了CodeIgniter select_value in form_dropdown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我的表单中有一个下拉字段,当我点击提交时,表单会通过验证,如果发生错误,则返回所有值.这项工作期待我的下拉菜单,我在下拉菜单中有 set_value 但它不起作用:(

                I have a dropdown field in my form and when I hit submit the form goes through validation and if an error happens, return all the value. This work expect for my dropdown meu, I have the set_value in the dropdown but it doesnt work :(

                这是我的代码

                <?php echo form_dropdown('gender', $gender, set_value('gender')); ?>
                

                我做错了什么或遗漏了什么?

                What am I doing wrong or missing?

                推荐答案

                这样做效果很好:

                <?php
                $selected = ($this->input->post('gender')) ? $this->input->post('gender') : 'M';  
                $gender = array("M" => "Male", "F" => "Female");
                echo form_dropdown('gender', $gender, $selected);
                ?>
                

                这篇关于CodeIgniter select_value in form_dropdown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:在 Zend Framework 2 中创建下拉列表 下一篇:PHP- 从数据库中获取并存储在下拉菜单 html 中

                相关文章

                最新文章

                <small id='Kz2wb'></small><noframes id='Kz2wb'>

              • <tfoot id='Kz2wb'></tfoot>
                • <bdo id='Kz2wb'></bdo><ul id='Kz2wb'></ul>
                <legend id='Kz2wb'><style id='Kz2wb'><dir id='Kz2wb'><q id='Kz2wb'></q></dir></style></legend>

                  <i id='Kz2wb'><tr id='Kz2wb'><dt id='Kz2wb'><q id='Kz2wb'><span id='Kz2wb'><b id='Kz2wb'><form id='Kz2wb'><ins id='Kz2wb'></ins><ul id='Kz2wb'></ul><sub id='Kz2wb'></sub></form><legend id='Kz2wb'></legend><bdo id='Kz2wb'><pre id='Kz2wb'><center id='Kz2wb'></center></pre></bdo></b><th id='Kz2wb'></th></span></q></dt></tr></i><div id='Kz2wb'><tfoot id='Kz2wb'></tfoot><dl id='Kz2wb'><fieldset id='Kz2wb'></fieldset></dl></div>