I have a selectOneRadio component containing some selectItem elements:
<h:selectOneRadio id="attribute_type" layout="pageDirection" styleClass="required radioBtn"
value="#{bean.someField}"
onclick="this.form.submit()"
valueChangeListener="#{bean.someMethod}">
<f:selectItem styleClass="radiob" itemLabel="something1" itemValue="0" />
...
<f:selectItem class="rad" itemLabel="somethingN" itemValue="3" />
</h:selectOneRadio>
I want to get the value of the selected button, but as you can see, the ids starts with "form:attribute_type:" They are like: form:attribute_type1, form:attribute_type2...
Using this example doesn't work.
var radioButtonValue = $('[id^=form:attribute_type]').value
or var radioButtonValue = $('[id^=form:attribute_type]').value
Could you tell a sintax to select by id starting with some pattern?