<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Refferencing SharePoint form fields with JavaScript</title>
	<atom:link href="http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/</link>
	<description>and Boris Gomiunik</description>
	<lastBuildDate>Tue, 07 Feb 2012 12:17:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Maggie</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-95</link>
		<dc:creator>Maggie</dc:creator>
		<pubDate>Thu, 11 Nov 2010 15:40:47 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-95</guid>
		<description>Hi Erik,

I know this is an old posting, but I&#039;m trying to get your code to work and I guess I don&#039;t understand it completely.  Could you please send me a complete code sample including getElementByID and the call to getField?  I&#039;m a beginner with JavaScript and when I try to use the code above, I keep getting errors or null values -- I&#039;m sure my syntax is wrong and I just need a little help.  Thank you for any help and time you can offer.

Maggie</description>
		<content:encoded><![CDATA[<p>Hi Erik,</p>
<p>I know this is an old posting, but I&#8217;m trying to get your code to work and I guess I don&#8217;t understand it completely.  Could you please send me a complete code sample including getElementByID and the call to getField?  I&#8217;m a beginner with JavaScript and when I try to use the code above, I keep getting errors or null values &#8212; I&#8217;m sure my syntax is wrong and I just need a little help.  Thank you for any help and time you can offer.</p>
<p>Maggie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Gomiunik</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-94</link>
		<dc:creator>Boris Gomiunik</dc:creator>
		<pubDate>Sun, 15 Aug 2010 14:17:44 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-94</guid>
		<description>@Joe H: The error could be if you&#039;re putting this script above the list form. At that point the field doesn&#039;t exist yet and it can&#039;t be referenced. If it still doesn&#039;t work after putting it below the form, You can make an experiment by typing the following in the URL of your browser bar: javascript:getField(&#039;input&#039;,&#039;Number&#039;)
You should get an alert telling something like [Object]. this is the sign that the script is OK. If it alerts something like that then you should wrap the entire script in a function and call this function using the _spBodyOnLoadFunctionNames array.</description>
		<content:encoded><![CDATA[<p>@Joe H: The error could be if you&#8217;re putting this script above the list form. At that point the field doesn&#8217;t exist yet and it can&#8217;t be referenced. If it still doesn&#8217;t work after putting it below the form, You can make an experiment by typing the following in the URL of your browser bar: javascript:getField(&#8216;input&#8217;,'Number&#8217;)<br />
You should get an alert telling something like [Object]. this is the sign that the script is OK. If it alerts something like that then you should wrap the entire script in a function and call this function using the _spBodyOnLoadFunctionNames array.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe H</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-93</link>
		<dc:creator>Joe H</dc:creator>
		<pubDate>Tue, 10 Aug 2010 14:21:58 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-93</guid>
		<description>First of all, great blog - very informative!

I am having trouble implementing your code above. I&#039;d like to read a sharepoint field into my javascript for redirecting a page after X seconds - X being the number in a SharePoint number field called Number. If i bypass reading the field into the javascript, this works fine, so i must not be referencing it properly. Below is my code:


function getField(fieldType,fieldTitle) {
    var docTags = document.getElementsByTagName(fieldType);
    for (var i=0; i &lt; docTags.length; i++) {
        if (docTags[i].title == fieldTitle) {
            return docTags[i]
        }
    }
}


var initial = getField(&#039;input&#039;,&#039;Number&#039;).value
var redirect = initial*1000

setTimeout(&#039;location.href=&quot;/sites/Collection/site/page.aspx&quot;&#039;,redirect);</description>
		<content:encoded><![CDATA[<p>First of all, great blog &#8211; very informative!</p>
<p>I am having trouble implementing your code above. I&#8217;d like to read a sharepoint field into my javascript for redirecting a page after X seconds &#8211; X being the number in a SharePoint number field called Number. If i bypass reading the field into the javascript, this works fine, so i must not be referencing it properly. Below is my code:</p>
<p>function getField(fieldType,fieldTitle) {<br />
    var docTags = document.getElementsByTagName(fieldType);<br />
    for (var i=0; i &lt; docTags.length; i++) {<br />
        if (docTags[i].title == fieldTitle) {<br />
            return docTags[i]<br />
        }<br />
    }<br />
}</p>
<p>var initial = getField(&#039;input&#039;,&#039;Number&#039;).value<br />
var redirect = initial*1000</p>
<p>setTimeout(&#039;location.href=&quot;/sites/Collection/site/page.aspx&quot;&#039;,redirect);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Addis Abebayehu</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-92</link>
		<dc:creator>Addis Abebayehu</dc:creator>
		<pubDate>Wed, 05 May 2010 17:37:49 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-92</guid>
		<description>I was wandering if anybody had workd on or have an idea how this will be accomplished. I am adding a link in the toolbar of a dispform.aspx page. This link will opens up outlook and embed the dispform aspx fildes in the body of of the outlook. It will also pull the title name or id from the dispform.aspx page and add it to the subject field of outlook. How is this accomplished? Can I copy the dispform.aspx and paste it in outlook programatically? Please help.
Thank you1</description>
		<content:encoded><![CDATA[<p>I was wandering if anybody had workd on or have an idea how this will be accomplished. I am adding a link in the toolbar of a dispform.aspx page. This link will opens up outlook and embed the dispform aspx fildes in the body of of the outlook. It will also pull the title name or id from the dispform.aspx page and add it to the subject field of outlook. How is this accomplished? Can I copy the dispform.aspx and paste it in outlook programatically? Please help.<br />
Thank you1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SharePoint Lookup field: how does it work and how to add JavaScript event handler function to it? &#124; SharePoint</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-91</link>
		<dc:creator>SharePoint Lookup field: how does it work and how to add JavaScript event handler function to it? &#124; SharePoint</dc:creator>
		<pubDate>Sun, 25 Oct 2009 22:26:34 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-91</guid>
		<description>[...] that equals the field display name, so you can easily use the getField function that is published here. So you can also easily bind an “onchange” event to [...] </description>
		<content:encoded><![CDATA[<p>[...] that equals the field display name, so you can easily use the getField function that is published here. So you can also easily bind an “onchange” event to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-90</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 25 Mar 2008 14:37:00 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-90</guid>
		<description>Hi,&lt;br/&gt;&lt;br/&gt;I posted the script snippet for the toggle option on the MSDN blog page but I&#039;m short on time and have a system about to go live where Date Picker is being used for the start and end time fields in a list and users are complaining that they have to manually type the dates in. &lt;br/&gt;&lt;br/&gt;Can you please send me a copy of the routine you used, because I&#039;m having trouble enabling it?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I posted the script snippet for the toggle option on the MSDN blog page but I&#8217;m short on time and have a system about to go live where Date Picker is being used for the start and end time fields in a list and users are complaining that they have to manually type the dates in. </p>
<p>Can you please send me a copy of the routine you used, because I&#8217;m having trouble enabling it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanker</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-89</link>
		<dc:creator>Tanker</dc:creator>
		<pubDate>Wed, 20 Feb 2008 18:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-89</guid>
		<description>Go ahead. If you want the whole code let me know and I can email it to you. &lt;br/&gt;&lt;br/&gt;Not sure you want it dumped here.&lt;br/&gt;I logged in with my Google Id this time so if you want to reach me you can through that. &lt;br/&gt;&lt;br/&gt;thanks</description>
		<content:encoded><![CDATA[<p>Go ahead. If you want the whole code let me know and I can email it to you. </p>
<p>Not sure you want it dumped here.<br />I logged in with my Google Id this time so if you want to reach me you can through that. </p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Gomiunik</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-88</link>
		<dc:creator>Boris Gomiunik</dc:creator>
		<pubDate>Wed, 20 Feb 2008 16:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-88</guid>
		<description>Erik, that&#039;s great. Would you mind if I&#039;d make an extra post about this?</description>
		<content:encoded><![CDATA[<p>Erik, that&#8217;s great. Would you mind if I&#8217;d make an extra post about this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-87</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Tue, 19 Feb 2008 17:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-87</guid>
		<description>On the drive home I figured out how to access the time fields, The id on the Hour/Minute fields use the same ID as the date field but with hours and minutes added to the end, So I added two new vars:&lt;br/&gt;var myID_Hours&lt;br/&gt;var myID_Minutes&lt;br/&gt;&lt;br/&gt;Then added the following lines into your function above the return:&lt;br/&gt;myID_Hours = docTags[i].id+&quot;Hours&quot;;&lt;br/&gt;myID_Minutes = docTags[i].id+&quot;Minutes&quot;;&lt;br/&gt;&lt;br/&gt;This lets me reference the Hour/Minute field with getElementByID&lt;br/&gt;&lt;br/&gt;I hope this helps someone else. Drove me nutes. :D</description>
		<content:encoded><![CDATA[<p>On the drive home I figured out how to access the time fields, The id on the Hour/Minute fields use the same ID as the date field but with hours and minutes added to the end, So I added two new vars:<br />var myID_Hours<br />var myID_Minutes</p>
<p>Then added the following lines into your function above the return:<br />myID_Hours = docTags[i].id+&#8221;Hours&#8221;;<br />myID_Minutes = docTags[i].id+&#8221;Minutes&#8221;;</p>
<p>This lets me reference the Hour/Minute field with getElementByID</p>
<p>I hope this helps someone else. Drove me nutes. <img src='http://www.sharepointboris.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://www.sharepointboris.net/2007/07/refferencing-sharepoint-form-fields-with-javascript/#comment-86</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Mon, 18 Feb 2008 21:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=73#comment-86</guid>
		<description>Thanks for the great tip on that explorer Boris. &lt;br/&gt;&lt;br/&gt;My problem is that the Date/Time fields are one field with a single Title but separate Id&#039;s. I can modify the date part of the field no problem, it&#039;s accessing the Hours/Minutes that is giving me grief. Everything I find will only work with Titles. &lt;br/&gt;&lt;br/&gt;Is there a way to set the value of the field based on the ID? I know SP adds the page information to the front of the field ID&#039;s which makes it difficult to pick them out to set them.&lt;br/&gt;&lt;br/&gt;Thanks.</description>
		<content:encoded><![CDATA[<p>Thanks for the great tip on that explorer Boris. </p>
<p>My problem is that the Date/Time fields are one field with a single Title but separate Id&#8217;s. I can modify the date part of the field no problem, it&#8217;s accessing the Hours/Minutes that is giving me grief. Everything I find will only work with Titles. </p>
<p>Is there a way to set the value of the field based on the ID? I know SP adds the page information to the front of the field ID&#8217;s which makes it difficult to pick them out to set them.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

