2 Replies Latest reply: Feb 7, 2012 10:33 AM by 915867 RSS

    insert html form tag inside another form tag

    915867
      Hi all, this is my issue. I have a xhtml page structured as following:

      <h:form id="mainForm">

      ....... some stuff........

      <form id="fileForm" action="myServlet" method="post" enctype="multipart/form-data">
           <input type="file" onchange="fileForm.submit()" />
      </form>
      </h:form>

      When uploading a file, I wanna submit only 'fileForm'. But "fileForm.submit()" doesn't work because fileFom is null. Looking at the page source, I realized that only one form is seen client-side (the mainForm):

      <form id="mainForm">

      ....... some stuff........

           <input type="file" onchange="fileForm.submit()" />
      </form>

      Any idea on how to implement it?
      Thanks in advance...