Your js code isn't valid
<t:selectOneMenu id="query_menu" value = "#{bean.metnod2}" onclick ="alert(document.forms['input-form'].elements['search_text'].value)"> I added a tick to the end of elements['search_text before the ].value)" part.

bs wrote:
Hi,

<h:form id="input-form">
...
<t:inputText forceId = "true" id = "search_txt" value = "#{bean.method1}" forceId="true"/>

<t:selectOneMenu id="query_menu" value = "#{ bean.metnod2}" onclick ="alert('hi how are you')">
....
</h:form>

<t:selectOneMenu id="query_menu" value = "#{bean.metnod2}" onclick ="alert(document.forms['input-form'].elements['search_text].value)">

in the onclick method i display an alert, it works fine if i choose a string("hi how are you") but if i try to dynamically display a value from the text it gives me a errot telling that " properties not found".

this error is bugging me for quiet some time, am i writing the syntax for javascript correct?

Thank you for reading my message




Reply via email to