I have a form in which some fields should be disabled until the checkbox is checked. For JSF elements, everything works fine. The problem is with the elements of the element.
For a JSF element, such as a drop-down list, I do this as follows:
<h:selectOneMenu value="countryValue" disabled="true" id="countryId">
<f:selectItems value="countries" />
</h:selectOneMenu>
And for Primefaces-elements, a calendar list:
<p:calendar disabled="true" id="datePicker" value="dateValue"
pattern="yyyy-MM-dd" startWeekday="1"
timeZone="GMT">
</p:calendar>
The JavaScript I used to include these elements in the event is simple as:
function enableLocationUpdateFilter()
{
document.getElementById('form:datePicker').disabled = false;
}
jQuery calling onchange-event:
jQuery('.countryCheckBoxId').change(function()
{
enableCountryFilter();
});
Primefaces firebug, , id "datePicker" "span" id, id HTML "datePicker_input". , , "datePicker" javascript, "datePicker_input". , jQuery, , .
, jquery-. jquery- , true. , , false.