Subject: [xsl] Inserting contents of HTML input box into xsl:attribute From: "Stephen English" <senglish@xxxxxxxxxxxxxxxxxxx> Date: Mon, 18 Aug 2003 09:24:38 +0930 |
This is a search across two databases. See NOTE 1 This is the onclick command and it runs function CreateSS which builds the search string See NOTE 2 THe results of CreateSS is placed in the ss input field See NOTE 3 I am trying to put the contents of the ss Input field into the second search string which I need to build up on the line above and below this note The question is how do I put the result of a javascript function or of an HTML input box into an xsl attribute? Any assistance will be greatly appreciated Thank you Stephen English <!--I have this at top of my stylesheet--> <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:my="urn:my-namespace"> <xsl:output method="html" /> <xsl:template match="advancedsearch" mode="link"> <xsl:variable name="pgspecified"><xsl:value-of select="@pg"/></xsl:variable> <FORM NAME="searchform" METHOD="post"> <xsl:attribute name="action">http://<xsl:value-of select="$baseurl"/>SearchRequest3</xsl:attribute> <INPUT TYPE="hidden" NAME="stypen" VALUE="html"/> <INPUT TYPE="hidden" NAME="maxresults" VALUE="20"/> <INPUT TYPE="hidden" NAME="searchpage" VALUE="1"/> <!--<INPUT TYPE="hidden" NAME="reset" VALUE="true"/> --> <INPUT TYPE="hidden" NAME="clear" VALUE="true"/> <xsl:element name="INPUT"> <xsl:attribute name="TYPE"> <xsl:text>hidden</xsl:text> </xsl:attribute> <xsl:attribute name="NAME"> <xsl:text>pg</xsl:text> </xsl:attribute> <xsl:choose> <xsl:when test="$pgspecified"> <xsl:attribute name="VALUE"><xsl:value-of select="$pgspecified"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="VALUE"><xsl:value-of select="//doc/@pageid"/></xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:element> <!-- Start of Advanced Search box--> <TABLE BORDER="0" CELLSPACING="0" class="body" > <TR VALIGN="top" ALIGN="left"> <td width="110"> <!-- NOTE 1 --> <INPUT type="button" value="Search Now" name="FormsButton1" onclick="CreateSS();" size="18"> </INPUT><br /> </td> <td width="3"></td> <td colspan="3" width="-1%"> <table > <td BGCOLOR="#feebc6"> <B>Search: </B><BR/> <INPUT id="FormsEditField1" NAME="ss1" SIZE="73" MAXLENGTH="100" > </INPUT> </td> </table> </td> </TR> <!-- NOTE 2 --> <tr><td colspan="6"> <INPUT id="FormsEditField1" NAME="ss" SIZE="93" MAXLENGTH="240" > <xsl:attribute name="value"><xsl:value-of select="//SearchResults/searchparameters" /></xsl:attribute> </INPUT> </td> </tr> </TABLE> <!-- Now we need parameters for second server --> <xsl:element name="INPUT"> <xsl:attribute name="TYPE"><xsl:text>hidden</xsl:text></xsl:attribute> <xsl:attribute name="NAME"><xsl:text>url</xsl:text></xsl:attribute> <xsl:attribute name="VALUE"> <xsl:value-of select="$remotedatabase" />%26ss= <!-- NOTE 3 --> <!-- It doesn't like the next line <xsl:value-of select="string(my:SearchString())"/> </xsl:attribute> </xsl:element> <msxsl:script language="javascript" implements-prefix="my"><![CDATA[ function SearchString(){ return document.searchform.ss.value } ]]> </msxsl:script> <INPUT TYPE="hidden" NAME="url" VALUE="local"/> <script language="javascript" > function CreateSS() { document.recalc(true); var ssTotal=""; // If CSU = True then we only want to include CSU info documents if (document.searchform.CSU.checked==true){ ssTotal = "'" + 'CSU=' + '"True"' + "'"; } // Obtain search string box values var ssText=""; ssText=document.searchform.ss1.value if (ssText.length > 0){ if (ssTotal.length > 0 ){ ssTotal = ssTotal + "+" + ssText; } else{ ssTotal = ssText; } } document.searchform.ss.value = ssTotal document.searchform.submit(); ssTotal="" } <!--<msxsl:script xmlns:msxsl="urn:schemas-microsoft-com:xslt" language="VBScript" implements-prefix="ms"> --> <!--</msxsl:script> --> </script> <!-- End of Advanced Search--> </FORM> </xsl:template> Stephen D. English Business Analyst - eBusiness City of Salisbury South Australia Tel: (08) 8406 8551 http://www.salisbury.sa.gov.au Email: senglish@xxxxxxxxxxxxxxxxxxx Fax (08) 8281 5466 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Client Side XSLT, Nic | Thread | [xsl] Mixed Content Substring(), James Cummings |
Re: [xsl] What is a good way to sty, Peter Flynn | Date | RE: [xsl] document() function can't, Américo Albuquerque |
Month |