使用 Get 或 Post 以表单发送 Bootstrap Button-Group 值 [英] Send Bootstrap Button-Group value in a form with Get or Post
本文介绍了使用 Get 或 Post 以表单发送 Bootstrap Button-Group 值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用 bootstrap 3 创建了这个表单:
</表单>
我正在使用按钮组,因为它看起来比下拉菜单或复选框更好.
我尝试通过 _get 方法发送 btn-group 值,但它不起作用.那么如何使用我的 _get 方法将值提交到我的 PHP 文件中?
感谢您的帮助
解决方案
我找到了解决方案
<label class="btn btn-primary"><input type="radio" id="NA" name="region" value="NA" autofocus="true"/>不适用标签><label class="btn btn-primary"><input type="radio" id="EUW" name="region" value="EUW"/>EUW标签><label class="btn btn-primary"><input type="radio" id="EUNE" name="region" value="EUNE"/>欧盟标签><label class="btn btn-primary"><input type="radio" id="BR" name="region" value="BR"/>BR标签><label class="btn btn-primary"><input type="radio" id="TR" name="region" value="TR"/>TR标签><label class="btn btn-primary"><input type="radio" id="RU" name="region" value="RU"/>茹标签><label class="btn btn-primary"><input type="radio" id="LAN" name="region" value="LAN"/>局域网标签><label class="btn btn-primary"><input type="radio" id="LAS" name="region" value="LAS"/>激光雷达标签><label class="btn btn-primary"><input type="radio" id="OCE" name="region" value="OCE"/>欧洲经委会标签>
I created this form with 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>
Im using the button group, because it looks better then a dropdwon menue or just checkboxes.
I tried to send the btn-group value by the _get methode but it does not work. So how can in submit the value with my _get methode to my PHP file?
Thank you for helping
解决方案
I found a solution
<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>
这篇关于使用 Get 或 Post 以表单发送 Bootstrap Button-Group 值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文