归档值使用复选框意外更改

时间:2018-09-30 17:35:02

标签: php html laravel character-encoding special-characters

我有多个复选框及其字段名称,但是我不知道我在哪里做错了字段更改的名称,我无法找出问题出在哪里。

当复选框的值合适时,这里是我的屏幕截图:here is fine fields working good

这是屏幕截图,上面有多个问号?这些变得烦人 this fields value are with ???? there should not any question marks in this field

我的表单中这些复选框的值是:

                  <form id="preferences_form" role="form" method="POST" novalidate action="{{ url('/preference') }}" class="mujucet-registration">
                            {{ csrf_field() }}
                            <h5>Nastavení zpráv</h5>
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="checkbox">
                                        <label  for="ch1">
                                            <input type="checkbox" name="monthly" value="1" id="ch1"><span class="cr"><i class="cr-icon fa fa-check"></i></span>Mesícní výpisy
                                        </label>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="checkbox">
                                        <label >
                                            <input type="checkbox" name="weekly" value="1"><span class="cr"><i class="cr-icon fa fa-check"></i></span>Týdenní prehled
                                        </label>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="tax_reviews" value="1"><span class="cr"><i class="cr-icon fa fa-check"></i></span>Danové výpisy
                                        </label>
                                    </div>
                                </div>

                                <div class="col-md-4">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="quarterly" value="1"><span class="cr"><i class="cr-icon fa fa-check"></i></span>Ctvrtletní výpisy
                                        </label>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="annually" value="1"><span class="cr"><i class="cr-icon fa fa-check"></i></span>Rocní výpisy
                                        </label>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="newsletter" value="1"><span class="cr"><i class="cr-icon fa fa-check"></i></span>Novinky
                                        </label>
                                    </div>
                                </div>

                                <div class="col-md-12">
                                    <div class="checkbox">
                                        <label class="border">
                                            <input type="checkbox" name="direct_mail_reviews" value="1"><span class="cr"><i class="cr-icon fa fa-check"></i></span> Chci výpisy zasílat také Poštou <span class="light">20 kc za výpis</span>
                                        </label>
                                    </div>
                                </div>

                            </div><h5>Kontaktní preference</h5>
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="email" value="1"><span class="cr"><i class="cr-icon fa fa-check"></i></span>Email
                                        </label>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="sms" value="1"><span class="cr"><i class="cr-icon fa fa-check"></i></span>SMS
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </form>                    </div>

我不喜欢我的复选框的值在这里很奇怪,您的帮助将受到高度赞赏!

1 个答案:

答案 0 :(得分:0)

对我来说,这似乎是编码问题。确保在两种情况下都使用相同的视图,并且在两种情况下都使用相同的编码(我假设为UTF-8):

<meta charset="utf-8">

在HTML的<head>部分中。

还要确保文件以与上面声明的相同的编码保存。