Lets say we have this code
<h:form id="#{id}">
<h:panelGroup id="#{id}suggestionPanel">
<h:panelGroup>
<h:inputText value="#{searchString}"
rendered="#{validationId == null}"
id="#{id}search"
onkeyup="autocompleteHandler(this.value)"/>
</h:panelGroup>
</h:panelGroup>
</h:form>
Is there a possibility to pass into the JavaScript method called “autocompleteHandler” the Id of the form, or get the Id trough other means then getElementById.
Hello I figured out a way how to get the Id of the outer form, so I wanna share it with you.
This doesn’t limit you to an input tag or something.
the javascript would look something like this.