Wednesday, 11 September 2013

Using bootstrap-select

Using bootstrap-select

I am supposed to use bootstrap-select to give a user a choice of titles
e.g. Mr, Mrs or Ms.
Here's the select HTML:
<select name="adultSelect" class="selectpicker adultTitle_">
<option value="1">Mr</option>
<option value="2">Mrs</option>
<option value="3">Ms</option>
</select>
I want to assign the value to a variable in the backing bean when the user
clicks the form's submit button. For example, here's how I do the user's
surname:
<div>
<h:inputText value ="#{bean.surname}" label="Surname"></h:inputText>
</div>
From what I can see, the <select> tag doesn't have a value attribute
available to it.
The JS I have for the selectpicker looks like this:
$(".selectpicker").selectpicker({
style: "btn",
size: 3
});

No comments:

Post a Comment