Getting JSF-defined component with Javascript
问题 I'm creating an interface using JSF, and I'd like the value of one text field to provide the default for a second if the second hasn't yet been set. The crucial code will look something like this: <h:outputScript> function suggestValue2() { var value2 = document.getElementById('value2').value; if (value2 == "") { document.getElementById('value2').value = document.getElementById('value1').value; } } </h:outputScript> <h:inputText id="value1" onblur="suggestValue2();" /> <h:inputText id="value2