0 Replies Latest reply on Mar 31, 2010 11:32 AM by phanthang1988

    Error JavaScript in JSF Portlet When use Richfaces!

      Hello Everybody!
      I'm a student come from VietNam!
      I'm studying about Richface framework!
      I had got a problem in JSF(Richface) Portlet when I used JavaScript!
      That problem is : I could not get a value into a <h:inputText />  with JavaScript!
      Can anybody help me?
      Thank you very much!

       

      This is my code:

       

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:h="http://java.sun.com/jsf/html">

       

          <f:view>
               <script type="text/javascript">
               function check() {
                    var result = document.getElementById("myform:form").value;
                            alert(result);
               }
                </script>

       

              <h:form id="myform">

       

                         <h3>Hello :</h3>

       

                          <h:inputText value="" id="form" />

       

                          <h:commandButton value="OK"  onclick="check();"/>

       

                                       </h:form>

       

              </f:view>

       

      </ui:composition>

       


      And this is a error report in a Error Console in Firefox:

      errorJS.bmp

       

      Can anybody help me?

      Thank you very much!

       

      ThangPhan!