p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XSLT (http://p2p.wrox.com/forumdisplay.php?f=86)
-   -   Accessing selected value in combobox (http://p2p.wrox.com/showthread.php?t=71345)

GISGeek November 6th, 2008 04:48 PM

Accessing selected value in combobox
 
<select id="DistrictID" name ="Distict" width="10">
        <option> xsl:value-of select= "1"/></option>
    <option><xsl:value-of select= "2"/></option>
    <option><xsl:value-of select= "3"/></option>
    <option><xsl:value-of select= "4"/></option>
    <option><xsl:value-of select= "5"/></option>
    <option><xsl:value-of select= "6"/></option>
    <option><xsl:value-of select= "7"/></option>
    <option><xsl:value-of select= "8"/></option>
</select>

I have created and filled a combobox as showen above.
Now, I need to create a table based on the selected value by the user from the combobox (district). I have created a button underneath the combobox. When the user selects a number and clicks the button, I want to call a function in javascript to retireve the values of selected number in the combobox and create a table. How can I do this?


samjudson November 6th, 2008 04:53 PM

What has this got to do with XSLT? If you have a JavaScript question I recommend you ask on a JavaScript forum.

/- Sam Judson : Wrox Technical Editor -/

GISGeek November 6th, 2008 05:20 PM

I am new to xsl. I am currently working on creating a xsl document to post xml information over the web. javascript is just part of it.

What I need to do when user clicks a submit button, table relevant to the selected item in the combo box should appear at the bottom of the button. The table is created by accessing xml document. Can you share a sample that uses onclick even to create a table?


mhkay November 6th, 2008 07:10 PM

An XSLT stylesheet cannot respond to user input. The stylesheet generates the HTML and exits; once the user starts pressing buttons, XSLT is no longer involved. Of course, it is possible for the Javascript in your (generated) HTML page to respond to user input by firing off another XSLT transformation, if that's what you want to do.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference


All times are GMT -4. The time now is 06:48 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.