XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
steven matthewsSubject: Identifying form fields after form submission
Author: steven matthews
Date: 01 Apr 2007 03:22 PM
I am trying to generate an ordered list where each <li> member contains some text (a question) and a an <input /> field.
The problem is that I need to be able to identify these <input /> fields when the form is submitted. I am using
<xsl:variable name = "Question_ID" ><xsl:value-of select="Q_ID"/></xsl:variable> but I am not sure if this correct since I know that

you cannot change a declared XSL variable once it is set. Here is the code ...

<form
class = "short"
name="activityform"
action=""
method="POST"
onsubmit_="return true">

<ol>

<xsl:for-each select="short_answer">

<!-- display questions as an ordered list -->
<li><label><xsl:value-of select="question"/></label>
<xsl:variable name = "Question_ID" ><xsl:value-of select="Q_ID"/></xsl:variable>
<input class = "" name = "{$Question_ID}" type = "text" size = "80" value = "" /></li><br /><br />

</xsl:for-each><br /><br />

</ol>

<input type="submit" value= "Submit task" /><br />
</form>


Do you have any suggestions ?

regards,

Steven

Postnext
Ivan PedruzziSubject: Identifying form fields after form submission
Author: Ivan Pedruzzi
Date: 01 Apr 2007 11:48 PM

variable Question_ID is created on each iteration therefore your solution works, however you don't need really need a variable in this case

<li>
<label><xsl:value-of select="question"/></label>
<input class = "" name="{Q_ID}" type = "text" size="80" value=""/>
</li>



Ivan Pedruzzi
Stylus Studio Team
http://www.stylusstudio.com/xml_download.html

Posttop
steven matthewsSubject: Identifying form fields after form submission
Author: steven matthews
Date: 02 Apr 2007 03:54 AM
Thanks Ivan !

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.