Although I'm pretty late to the party I think there is a cleaner way to do it without Javascript. When you include the namespace xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
you can pass attributes through to the generated HTML and you can hence directly set the attribute in your JSF code:
<p:inputTextarea value="#{mybean.cardescription}"
cols="95"
pt:spellcheck="false"
autoResize="true"
rows="20"/>
This works for all HTML attributes that do not have a corresponding JSF attribute in their components.
The pt
is selected here to avoid namespace collisions with PrimeFaces. You'll also find p
for passthrough attributes pretty often.
$('inputTextId').attr('spellcheck','false')
, or you should write a custom renderer for the inputTextarea.. Also I'm not sure if the Html5RenderKit of OmniFaces would work on PrimeFaces inputTextarea but it should be. – Epner