Hi everyone,
I am trying to implement a dropdown menu that gets populated by data from the xml file. The user could then make a choice from this menu, and according to the choice made, a different image is to be displayed. The "SRC" is also to be obtained from the xxml file.
What I have done uptil now is to populate the menu from the xml file, but have difficulty in displaying the image according to the user's choice.
Below is what I have done uptil now:
<td>
<select name="Menu" onChange="printer.src='{image}';">
<option>Inkjet Models</option>
<xsl:for-each select="Printers/Inkjet">
<option value="{image}">
<xsl:value-of select="model"/>
</option>
<xsl:for-each>
</select>
</td>
</tr>
<tr>
<td border="1" valign="middle">
<img name="printer" src="blank.gif"/>
</td>
Extraxt from my XML File
<Printers>
<Inkjet>
<model>Stylus C86</model>
<Colour>Separate Cartridges</Colour>
<ColourPrice>None</ColourPrice>
<colourYellow>C13T045440</colourYellow>
<colourYellowPrice>Lm 6.00</colourYellowPrice>
<colourCyan>C13T045240</colourCyan>
<colourCyanPrice>Lm 6.00</colourCyanPrice>
<colourmagenda>C13T045340</colourmagenda>
<colourMagendaPrice>Lm 6.00</colourMagendaPrice>
<Black>C13T04410</Black>
<blackPrice>Lm 9.50</blackPrice>
<image>C86.gif</image>
</Inkjet>
</Printers>
I really appreciate any help. Kindly let me know if i was not clear in my explanation.
Thanks in anticipation,
Alan
I am trying to implement a dropdown menu that gets populated by data from the xml file. The user could then make a choice from this menu, and according to the choice made, a different image is to be displayed. The "SRC" is also to be obtained from the xxml file.
What I have done uptil now is to populate the menu from the xml file, but have difficulty in displaying the image according to the user's choice.
Below is what I have done uptil now:
<td>
<select name="Menu" onChange="printer.src='{image}';">
<option>Inkjet Models</option>
<xsl:for-each select="Printers/Inkjet">
<option value="{image}">
<xsl:value-of select="model"/>
</option>
<xsl:for-each>
</select>
</td>
</tr>
<tr>
<td border="1" valign="middle">
<img name="printer" src="blank.gif"/>
</td>
Extraxt from my XML File
<Printers>
<Inkjet>
<model>Stylus C86</model>
<Colour>Separate Cartridges</Colour>
<ColourPrice>None</ColourPrice>
<colourYellow>C13T045440</colourYellow>
<colourYellowPrice>Lm 6.00</colourYellowPrice>
<colourCyan>C13T045240</colourCyan>
<colourCyanPrice>Lm 6.00</colourCyanPrice>
<colourmagenda>C13T045340</colourmagenda>
<colourMagendaPrice>Lm 6.00</colourMagendaPrice>
<Black>C13T04410</Black>
<blackPrice>Lm 9.50</blackPrice>
<image>C86.gif</image>
</Inkjet>
</Printers>
I really appreciate any help. Kindly let me know if i was not clear in my explanation.
Thanks in anticipation,
Alan