[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: getting combo value,not textbox value

Subject: Re: getting combo value,not textbox value
From: himanshu padmanabhi <himanshu.padmanabhi@xxxxxxxxx>
Date: Fri, 27 Feb 2009 16:11:14 +0530
Re:  getting combo value
Thank you very much.I have tried this.
But problem here is, I am not submitting to 'one.cgi'.
'form.submit' doesn't work in this case.So I am not getting values
which 'one.cgi' should return.
-----------------------------------------------------------------------------
----
<xsl:template match="tracks">
    <form name="form1" method="POST" action="one.cgi">
    <table border="1">
        <tr>
            <td> Parameter </td>
            <td> Description </td>
            <td> Value
             <input type="hidden" name="idx" value="{$idx}"/>
             <input type="hidden" name="sidx" value="{$sidx}"/>
             <input type="hidden" name="new" value="{$new}" />
             </td>
        </tr>
        <xsl:apply-templates/>
    </table>
    </form>
    <script>
        document.form1.submit(); <!--tried with
documet.forms.form1.submit also -->
    </script>
</xsl:template>

<xsl:template match="one">
    <tr>
        <td>
            <xsl:value-of select="label"/>
        </td>
        <td>
            <xsl:value-of select="desc"/>
        </td>
        <td>
            <xsl:if test="label = 'machine name'">
                    <select name="machine_name">
                      <xsl:call-template name="str:tokenize">
                      </xsl:call-template>
                     </select>
             </xsl:if>
             <xsl:if test="label = 'limit'">
                  <input type="text" name="limit" value="">
                  </input>
             </xsl:if>
        </td>
    </tr>
  </xsl:template>
-----------------------------------------------------------------------------
----------------
Am I wrong somewhere here?chances are great.
please help.

On Fri, Feb 27, 2009 at 3:25 PM, Ronan Klyne <ronan.klyne@xxxxxxxxxxx> wrote:
> himanshu padmanabhi wrote:
>> This is my simple abc.xml
>>
>> <records>
>>     <one>
>>             <label>machine name</label>
>>             <desc>specify machine name</desc>
>>     </one>
>>     <one>
>>             <label>limit</label>
>>             <desc>specify limit which should not exceed</desc>
>>     </one>
>> </records>
>>
-----------------------------------------------------------------------------
--------------------------------------------------------
>> This is my corresponding abc.xsml
>>
>> <xsl:template match="records">
>>     <table border="1">
>>         <tr>
>>             <td> Parameter </td>
>>             <td> Description </td>
>>             <td> Value </td>
>>         </tr>
>>         <xsl:apply-templates/>
>>     </table>
>> </xsl:template>
>>
>> <xsl:template match="one">
>>     <form name="form1" method="POST" action="one.cgi">
>>     <tr>
>>         <td>
>>             <xsl:value-of select="label"/>
>>         </td>
>>         <td>
>>             <xsl:value-of select="desc"/>
>>         </td>
>>         <td>
>>             <xsl:if test="label = 'machine name'">
>>                     <select name="machine_name">
>>                       <xsl:call-template name="str:tokenize">
>>                       </xsl:call-template>
>>                      </select>
>>              </xsl:if>
>>              <xsl:if test="label = 'limit'">
>>                   <input type="text" name="limit" value="">
>>                   </input>
>>              </xsl:if>
>>         </td>
>>          <input type="hidden" name="idx" value="{$idx}"/>
>>          <input type="hidden" name="sidx" value="{$sidx}"/>
>>          <input type="hidden" name="new" value="{$new}" />
>>     </tr>
>>     </form>
>>     <script>
>>         document.form1.submit();
>>     </script>
>> </xsl:template>
>>
-----------------------------------------------------------------------------
-------------------
>> Here,'machine_name' is combo box and 'limit' is text box.But I am
>> getting only the value of combo(which I select) in the $in hash in
>> next fom and not textbox's value.Why?Please help.
>>
>> If I remove  'machine_name' entry from xml,xsl file,then I am getting
>> textbox's value in the $in hash in next form.
>>
>>
>> I am very poor in fundamentals of xml,xsl.I am even not sure how the
>> code flow is?
>> Means If there are 2 entries in XML file under tag 'one',then is
>> '<xsl:template match="one">' gets executed twice for each entry and
>> all.
>> I just started going through "XSLT Cookbook By  Sal Mangano".
>>
>
> This set of XML and XSL will generate two HTML forms, both named
> 'form1'. One form will have a combo box named 'machine_name' and the
> other form will have a text box named 'limit'.
>
> Only one of these forms is being submitted.
>
> You either need to move the <form> element to the template matching
> "records", or add a <input type="submit" /> element to each form so that
> the user can pick which to submit.
>
>
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 01189 028518
> ronan.klyne@xxxxxxxxxxx
> www.groupbc.com
>
>



--
Regards,
Himanshu Padmanabhi

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.