BootStrap 表单助手国家选择器 [英] BootStrap form Helper Country Picker

查看:39
本文介绍了BootStrap 表单助手国家选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用引导程序表单助手在 php 中创建表单.一切正常但我无法在 php 表单字段中获取国家/地区名称.country 字段使用 bootstrapformhelper 进行样式设置,它被包裹在 div 中而不是输入标签.

这是代码.

if(isset($_POST['country'])){$country= $_POST['country'];回声$国家;}?><form action="rough.php" method="post"><div id="country"class="col-sm-8 bfh-selectbox bfh-countries" data-country="NG" data-flags="true">

<输入类型=提交"值=提交"></表单>

如何获取 php 的值?

解决方案

<div id="country"class="col-sm-8 bfh-selectbox bfh-countries" data-country="NG"data-name="country" data-flags="true">

你得先有个名字.

if(isset($_POST["submit"])) {$country= $_POST['country'];//在这里插入查询}

现在你有了价值.请注意,这不会为您提供国家/地区的完整名称.例如,你选择美国,它会给你美国.

I am using bootstrap form helper to make a form in php. Everything is working fine But I am unable to get the country name in the php form field. The country field is styled with the bootstrapformhelper and it is wrapped in div instead to input tag.

Here is the code.

if(isset($_POST['country'])){
    $country= $_POST['country'];
    echo $country;
}
?>

<form action="rough.php" method="post">

    <div id="country"class="col-sm-8 bfh-selectbox bfh-countries" data-country="NG" data-flags="true">  
    </div>
    <input type="submit" value="submit">
</form>

How can I get the value to php?

解决方案

<div id="country"class="col-sm-8 bfh-selectbox bfh-countries" data-country="NG" data-name="country" data-flags="true">  
</div>

You need to have a name first.

if(isset($_POST["submit"])) {
$country= $_POST['country']; 
//INSERT QUERY HERE
}

Now you have the value. Note that this will not give you the complete name of the country. For example, you chose United States, it will give you US.

这篇关于BootStrap 表单助手国家选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆