xsl-list
[Top] [All Lists]

Re: [xsl] getting combo value,not textbox value

2009-02-28 09:54:37
himanshu padmanabhi wrote:

and this is my modified XSL file which is generating above html code.
It shows table with all elements as expected.Only form.submit not working.
please help.Is there any other way of form.submit.
Should I use hidden button to submit?

<xsl:template match="Records">
    <html>
    <body>
    <form name="form1" method="POST" action="one.cgi">
    <tr>
        <td>
            <xsl:value-of select="label1"/>
        </td>
        <td>
            <xsl:value-of select="desc1"/>
        </td>
        <td>
            <xsl:if test="label1 = 'machine name'">
                <select name="machine_name">
                    <xsl:call-template name="str:tokenize">
                    </xsl:call-template>
                </select>
            </xsl:if>
        </td>
    </tr>

     <tr>
         <td>
               <xsl:value-of select="label2"/>
         </td>
         <td>
               <xsl:value-of select="desc2"/>
        </td>
        <td>
            <xsl:if test="label2 = 'limit'">
                <input type="text" name="limit" value="" />
            </xsl:if>
        </td>
    </tr>
    </form>
    </body>
    </html>
    <script type="text/javascript">
          document.form1.submit();
    </script>
</xsl:template>

Move the script element inside of the body

   </form>
   <script type="text/javascript">
   document.forms.form1.submit();
   </script>
   </body>
   </html>

Also check the error console of your browser whether it shows any errors when the code does not work.

--

        Martin Honnen
        http://JavaScript.FAQTs.com/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>