Php 检索引导国家/地区选择器所选值

Php 检索引导国家/地区选择器所选值,php,twitter-bootstrap,post,Php,Twitter Bootstrap,Post,我使用Bootstrap form helper country picker列出国家,并希望检索所选值以将其插入db表中。如何检索所选值 <div id="country" class="bfh-selectbox bfh-countries" data-country="US" data-flags="true"> </div> 我尝试使用jQuery发送它,但没有检索到任何内容,我不知道所选选项保存在哪里 $("#reg_form").on("submit"

我使用Bootstrap form helper country picker列出国家,并希望检索所选值以将其插入db表中。如何检索所选值

<div id="country" class="bfh-selectbox bfh-countries" data-country="US" data-flags="true">
</div>

我尝试使用jQuery发送它,但没有检索到任何内容,我不知道所选选项保存在哪里

 $("#reg_form").on("submit", function () {
        var hvalue = $('#country').attr('data-country');
        $(this).append("<input type='hidden' name='country' value=' " + hvalue + " '/>");
    });
$(“#注册表格”)。关于(“提交”,函数(){
var hvalue=$('国家').attr('数据国家');
$(此)。追加(“”);
});
国家/地区选择器示例4的链接:

你可以试试这个你可以试试这个