将单选按钮值存储到Perfex CRM中的PHP Codeigniter数据库

rta7y2nd  于 2022-12-06  发布在  PHP
关注(0)|答案(1)|浏览(154)

我尝试将单选按钮值保存到Perfex CRM中的数据库,并且使用下面的代码成功地保存了选择下拉列表的值。

$accessability = [
                            0 => ["id" => "Yes", "name" => _l("Yes")],
                            1 => ["id" => "No", "name" => _l("No")],
                            2 => ["id" => "Not Applicable", "name" => _l("Not Applicable")]
                        ];
                        $value = isset($accessability)
                            ? $disscussion->accessability
                            : "";
                        echo render_select(
                            "accessability",
                            $accessability,
                            ["id", "name"],
                            "ACCESSABILITY TO PROPERTY WAS CLEAR",
                            $value
                        );
                        ?>

在这里,我尝试将单选按钮值存储到数据库。

<div class="col-md-12">                           
                        <div class="mtop10">
                           <span>ACCESSABILITY TO PROPERTY WAS CLEAR</span>

                            <div class="radio radio-primary radio-inline">
                              <input type="radio" value="1" id="1"  name="Yes" data-text="Yes" <?php if(isset($accessability)  ? $disscussion->accessability : ""; ?>>
                              <label for="1">Yes</label>
                            </div>

                            <div class="radio radio-primary radio-inline">
                            <input type="radio" value="1" id="2"  name="No" data-text="Yes" <?php if(isset($accessability)  ? $disscussion->accessability : ""; ?>>
                              <label for="2">No</label>
                            </div>
                        </div>
                    </div>

我是新的Codeignitor请帮助

egmofgnx

egmofgnx1#

<!-- Accessibility -->
                     <div class="form-group">
                            <label for="accessibility">Accessibility</label><br>
                            <div class="radio radio-primary radio-inline">
                                <input type="radio" name="accessibility" <?php if(isset($accessability) && $disscussion->accessability == 0){echo ' checked';}?> value="Yes" id="yes">
                                <label for="yes">Yes</label>
                            </div>
                            <div class="radio radio-primary radio-inline">
                                <input type="radio" name="accessibility" <?php if(isset($accessability) && $disscussion->accessability == 1){echo ' checked';}?> value="No" id="no">
                                <label for="no">No</label>
                            </div>
                     </div>

相关问题