Jump to content

aalbetski

Members
  • Posts

    331
  • Joined

  • Last visited

Posts posted by aalbetski

  1. you could capture the onunload event

    <script>	function unloading()	{		document.getElementById("storage").value = window.location		alert()	}</script><body onunload="unloading()">	<input type="text" id="storage"></input></body>

  2. I never tested it. It was mocked up to show you 1. How to auto post the page back ( Is it possible to submit the file automatically?)2. How to determine if the page was posted 3. How to set a value when the page was posted back (I need to assign a value to <input type="file" name="oFile1" size="20">. )You cannot set the input type=file to a value. That was told to you by me as well as another user in another forum. I simply showed how to fill a value for an input field (other than the file type)

  3. here is the entire page as I mocked up

    <%@language=javascript%><%var sFilename = "MyFile"%><body onload="oForm.submit()"><form name="oForm" action="/scripts/cpshost.dll?PUBLISH?<%=Application("PostingAcceptorUploadServerLocation")%>/scripts/charles/addTask.asp" enctype="multipart/form-data" method="post"><%	if (Request.ServerVariables("Request_Method") == "POST")	{		%><input type="text" value="<%=sFilename%>" name="oFile1" size="20" /><%	}%><input type="hidden" name="TargetURL" value="<%=Application("FileAttachments")%>/charles/"><p align="center"><input type="submit" value="Upload File"></p></form></body>

  4. you can post the page using a onload function<body onload="oForm.submit()">you can tell check if the page is being posted or notif (Request.ServerVariables("Request_Method") == "POST") {}But I don't think you can write to the value of the input type=file. This would work for any other control

    <%var sFilename = "MyFile"%><%	if (Request.ServerVariables("Request_Method") == "POST")	{		%><input type="text" value="<%=sFilename%>" name="oFile1" size="20" /><%	}%>

  5. not sure if this helps, but you could also use rowspan:

    <table border="1">		<tr><td>Cell</td><td rowspan="2">Cell<td>Cell</td></tr>		<tr><td>Cell</td><td>Cell</td></tr>	</table>

  6. this recursive routine will omit any attributes from the copy

    <xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  version="1.0">	<xsl:output method="xml"/>	<xsl:template match="/">		<xsl:apply-templates select="* | node() "/>	</xsl:template>	<xsl:template match="* | node()">		<xsl:copy>			<xsl:apply-templates select="* | node()"/>		</xsl:copy>	</xsl:template></xsl:stylesheet>

    Here is an output fragment

    <?xml version="1.0"?><standard_area><value>Arts</value><level><value>Alternate</value><standard><value>1-Creating, Performing and Participating in the Arts</value><key_idea_title><value>Movement</value><key_idea><value>happy time harry. </value><performance_indicator><value> create and perform simple dances. </value></performance_indicator><performance_indicator><value> identify and demonstrate movement elements and skills (such as bend, twist, slide, skip, hop, walk in a straight line). </value></performance_indicator><performance_indicator><value> interpret words into a dance. </value></performance_indicator><performance_indicator><value> participate in movement activities. </value></performance_indicator><performance_indicator><value> perform individually or in a group. </value></performance_indicator></key_idea></key_idea_title><key_idea_title>

    Note, to include the attributes. use this

    <xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  version="1.0">	<xsl:output method="xml"/>	<xsl:template match="/">		<xsl:apply-templates select="* | @* | node() "/>	</xsl:template>	<xsl:template match="* | @* | node()">		<xsl:copy>			<xsl:apply-templates select="* | @* | node()"/>		</xsl:copy>	</xsl:template></xsl:stylesheet>

  7. I had a similar situation where I needed to check the end of the control name, it was complicated by the fact that using Infragistics controls, they prepend a whole bunch of stuff to the control name as well. Here is one way:

    function CheckCheckBoxes()	{		re = new RegExp("^email_")				e = new Enumerator(form1.elements)		for (;!e.atEnd();e.moveNext())		   		{			x = e.item();			if (x.name.match(re))				{				// form element found matching the name "email_" at the beginning			}		}	}

  8. This looks like it could be done with a windows script host (WSH) file and an instance of an XML parser. As long as the appropriate permissions are in place, this would be a simple solution. I have attached a complete example (you will need to add the appropriate pieces to pass the filenames etc...)

    // WSH Example writte in javascript// this should be saved with a .js extension WScript //H:CScriptvar xmlFreeThreadDocProgID 	=	"Msxml2.FreeThreadedDOMDocument.4.0";var xmlTmp =  new ActiveXObject(xmlFreeThreadDocProgID)xmlTmp.async=falsexmlTmp.setProperty('NewParser', true) var sFileName  = "\\\\xx.xxx.xx.xxx\\d$\\xxxxx\\xxxxx\\Data\\xxxx.xml";WScript.Echo(sFileName)if (xmlTmp.load(sFileName) == false) {	WScript.Echo("failed to load")	WScript.Quit(1);}var oNode = xmlTmp.selectSingleNode("//Codes/C[V='0001']/D");WScript.Echo(oNode.text);

    I have, of course, xxxed out all references to my remote location and structure

  9. You actually do not need to change anything except the regexp operation. Changing to split(",") will fail because you would have changed the split conditions. Based on your original question, you wanted to learn how to use the Split method using the RegExp object. The following is the entire code you need to do this including only the numbers and not the letters (as the first example showed you)

    var myListString = "apple, 0.99, banana, 0.50, peach, 0.25, orange, 0.75";//var theRegExp = /[^a-z]+/i;var theRegExp = /[^0-9.]+/i;var myFruitArray = myListString.split(theRegExp);document.write(myFruitArray.join("<br>"));

    produces this result:0.990.500.250.75toggle the comment back and forth between theRegExp lines and you will see how the first excludes any numbers , the second excludes any letters.Changing the split to "," will include ALL elements in the array and this can still be useful if that's what you want. You could then iterate on every other item for the price. You would get this output:apple0.99banana0.50peach0.25orange0.75

  10. I added single quotes around true, seems to work

    <html><xml id="Activities">	<XMLDataPersistence>		<Duration>30</Duration>		<HistoryFields>		<Id>			<Mandatory>True</Mandatory>			<Modifiable>True</Modifiable>			<Type>Text</Type>		</Id>		</HistoryFields>	</XMLDataPersistence></xml><script>	var oNode = Activities.selectSingleNode("//XMLDataPersistence[Duration=30]")	document.write(oNode.xml)	document.write("<br>")	oNode = Activities.selectSingleNode("//XMLDataPersistence/HistoryFields/Id[Mandatory='True']")	document.write(oNode.xml)</script></html>

  11. try this

    <xsl:output method="html"/>	<xsl:template match="*">		<xsl:for-each select="//fact">			<xsl:sort select="slot[name='rank']/value" data-type="number" order="descending"/>			<xsl:value-of select="slot"/><br/>		</xsl:for-each>	</xsl:template></xsl:stylesheet>

    look closely at this vs yours and you'll see the differences

  12. you could add this before your redirectResponse.RedirectLocation = "_blank";of course, this is entirely out of context as to what you are trying to do, but this is how you can redirect to a new location. I didn't check if this was available before .net 2.0

  13. try using where exists:Select * from Table1 as T1 where exists (Table2 as T2 where T2.id = T1.id)and the reverse:Select * from Table1 as T1 where not exists (Table2 as T2 where T2.id = T1.id)

  14. You're on the right track, but you can can place your document node-set into a variable that can be accessed later on. A favorite technique of mine. Have a look. This is a complete example using four components1. methodfill.xml (file used to parse against the xslt, has no content, thats your job)2. method.xml (file called by the document function)3. method.xslt 4. method.htm (does the parsing)I'm not sure that I've explained this properly, but take a look at see if this is what you are trying to domethodfill.xml

    <top/>

    method.xsl

    <xsl:stylesheet		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"		xmlns:user="http://www.post-n-track.com"		xmlns:msxsl="urn:schemas-microsoft-com:xslt"		exclude-result-prefixes="msxsl user"		version="1.0">		<xsl:param name="descrFileName">Method.xml</xsl:param>		<xsl:template match="*">			<xsl:variable name="methods" select="document($descrFileName)//methods"/>			<xsl:apply-templates select="$methods//method[@name = 'steve']"/>		</xsl:template>		<xsl:template match="method">			<xsl:value-of select="data"/>		</xsl:template>	</xsl:stylesheet>

    method.xml

    <methods>	<method name="steve">		<data>Steven</data>	</method>		<method name="frank" />	<method name="john" /></methods>

    method.htm

    <script>	var m_xmlSource		= 	new ActiveXObject("Msxml2.DOMDocument.4.0")	var m_xslStyle 		=	new ActiveXObject("Msxml2.DOMDocument.4.0")	m_xmlSource.async 	= 	false	m_xslStyle.async	=	false	m_xmlSource.load("methodfill.xml")	m_xslStyle.load("method.xsl")	m_xslStyle.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'")	document.write(m_xmlSource.transformNode(m_xslStyle))</script>

    result

    Steven

×
×
  • Create New...