I use Bootstrap form helper country picker to list countries, and I want to retrieve the selected value to insert it in a db table. How can I retrieve the selected value?
<div id="country" class="bfh-selectbox bfh-countries" data-country="US" data-flags="true">
</div>
I tried to send it using jQuery, but nothing retrieved, I don't know where the selected option is saved!
$("#reg_form").on("submit", function () {
var hvalue = $('#country').attr('data-country');
$(this).append("<input type='hidden' name='country' value=' " + hvalue + " '/>");
});
Link for the country picker example 4: http://bootstrapformhelpers.com/country/#jquery-plugins