微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – 使用Get或Post在表单中发送Bootstrap Button-Group值

我用bootstrap 3创建了这个表单:

                        <form role="form" method="get" target="_self" action="checkplayer.PHP">
                        <div class="input-group">
                            <input type="text" class="form-control input-lg" placeholder="Search player" name="player">
                            <span class="input-group-btn">
                                <button class="btn btn-primary btn-lg" type="submit">Search</button>
                            </span>
                        </div><br>
                        <div class="btn-group">
                            <button name="region" type="button" class="btn btn-primary" value="NA" autofocus="true">NA</button>
                            <button name="region" type="button" class="btn btn-primary" value="EUW">EUW</button>
                            <button name="region" type="button" class="btn btn-primary" value="EUNE">EUNE</button>
                            <button name="region" type="button" class="btn btn-primary" value="BR">BR</button>
                            <button name="region" type="button" class="btn btn-primary" value="TR">TR</button>
                            <button name="region" type="button" class="btn btn-primary" value="RU">RU</button>
                            <button name="region" type="button" class="btn btn-primary" value="LAN">LAN</button>
                        </div>
                    </form>

我使用按钮组,因为它看起来比dropdwon menue或只是复选框更好.

我试图通过_get方法发送btn-group值,但它不起作用.
那么如何使用我的_get方法将值提交到我的PHP文件中呢?

感谢您的帮助

解决方法:

我找到了解决方

                            <div class="btn-group" data-toggle="buttons">
                            <label class="btn btn-primary">
                                <input type="radio" id="NA" name="region" value="NA" autofocus="true"/> NA
                            </label>
                            <label class="btn btn-primary">
                                <input type="radio" id="EUW" name="region" value="EUW" /> EUW
                            </label>
                            <label class="btn btn-primary">
                                <input type="radio" id="EUNE" name="region" value="EUNE" /> EUNE
                            </label>
                            <label class="btn btn-primary">
                                <input type="radio" id="BR" name="region" value="BR" /> BR
                            </label>
                            <label class="btn btn-primary">
                                <input type="radio" id="TR" name="region" value="TR" /> TR
                            </label>
                            <label class="btn btn-primary">
                                <input type="radio" id="RU" name="region" value="RU" /> RU
                            </label>
                            <label class="btn btn-primary">
                                <input type="radio" id="LAN" name="region" value="LAN" /> LAN
                            </label>
                            <label class="btn btn-primary">
                                <input type="radio" id="LAS" name="region" value="LAS" /> LAS
                            </label>
                            <label class="btn btn-primary">
                                <input type="radio" id="OCE" name="region" value="OCE" /> OCE
                            </label>
                        </div>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐