I've got 2 fields. One is a h:selectOneMenu with a list of places. the other is a h:inputText.
What i'm trying to do is, if the user selects place on the selectOneMenu, and clicks on search, it's gonna search for that place. If he selects a place on the selectOneMenu and still types someplace else on the inputText and clicks on search, it's gonna search for the place that was written and not the selected one.
So, it would be awesome if the user types anything on the inputtext, it would disable the selectOneMenu, and if he clear the field, it would be enabled again. I tried with javascript on event
onchange="if (this.value !='') document.getElementById('placeSelectOneMenu').disabled='true'"
but it didn't work. What can I do? Any ideas?
It only works when I click on search, than it reRender the field correctly. What I want is reRender dynamically.