<?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/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: Add functions and events to SharePoint form fields</title>
	<atom:link href="http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/</link>
	<description>Boris Gomiunik</description>
	<lastBuildDate>Thu, 11 Mar 2010 16:07:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Boris Gomiunik</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-454</link>
		<dc:creator>Boris Gomiunik</dc:creator>
		<pubDate>Wed, 03 Feb 2010 19:36:35 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-454</guid>
		<description>@Sreedhar: 
1. to make the radiobuttons appear in horisontal position you&#039;d need to remake the DOM of the radio buttons. Usually radio buttons choice field is rendered as a table and each row is containing one choice. So you&#039;d need to loop through rows 2 to n (n being total number of rows) and moving the innerHTML to additional tablecells created in the first row. It would require a bit of coding, for sure.
2. You can refference the row below and hide it as soon as the document is loaded. Then depending on choice you&#039;d show/hide this. Can you try the onclick event instead of onclientclick (the later is ASP.NET :)). 
Please stay tuned on my series on HTML DOM manipulation with JavaScript.</description>
		<content:encoded><![CDATA[<p>@Sreedhar:<br />
1. to make the radiobuttons appear in horisontal position you&#8217;d need to remake the DOM of the radio buttons. Usually radio buttons choice field is rendered as a table and each row is containing one choice. So you&#8217;d need to loop through rows 2 to n (n being total number of rows) and moving the innerHTML to additional tablecells created in the first row. It would require a bit of coding, for sure.<br />
2. You can refference the row below and hide it as soon as the document is loaded. Then depending on choice you&#8217;d show/hide this. Can you try the onclick event instead of onclientclick (the later is ASP.NET <img src='http://www.sharepointboris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).<br />
Please stay tuned on my series on HTML DOM manipulation with JavaScript.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreedhar</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-445</link>
		<dc:creator>Sreedhar</dc:creator>
		<pubDate>Mon, 01 Feb 2010 12:35:33 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-445</guid>
		<description>Hi Boris Gomiunik ,

I have read the post and it was useful to me. but can you can help with this problem.
 
I am having a radiobutton  field with two options yes and no

1. how can we make it appear in horizontal instead of default vertical postion.
2. how can we write javascript function to show the entire row below it depending upon radiobutton field value user selected

i have tried OnClientClick but i couldn&#039;t find that

is there any way to do this using SPD 2007

thanks</description>
		<content:encoded><![CDATA[<p>Hi Boris Gomiunik ,</p>
<p>I have read the post and it was useful to me. but can you can help with this problem.</p>
<p>I am having a radiobutton  field with two options yes and no</p>
<p>1. how can we make it appear in horizontal instead of default vertical postion.<br />
2. how can we write javascript function to show the entire row below it depending upon radiobutton field value user selected</p>
<p>i have tried OnClientClick but i couldn&#8217;t find that</p>
<p>is there any way to do this using SPD 2007</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Gomiunik</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-422</link>
		<dc:creator>Boris Gomiunik</dc:creator>
		<pubDate>Mon, 25 Jan 2010 07:51:10 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-422</guid>
		<description>@Brett: Hi. Can you try the following: 
1. The code must be inserted after the form (so the elements already exist)
2. If the code still doesn&#039;t work, it can probably be that the code runs before the fields are rendered by your browser. What you can try is to enclose the lines that attacth event in a function like this:

function attachEvents() {
getField(&#039;select&#039;,&#039;Enhancement&#039;).onchange = function() {alert(&#039;here&#039;)};
getField(&#039;select&#039;,&#039;Enhancement&#039;).onchange = function() {setVisibility()};
}

and then at the end of script put this function in a _spBodyOnLoadFunctionNames array so it will execute when SharePoint DOM is ready:

_spBodyOnLoadFunctionNames.push(&quot;attachEvents&quot;)

Hope this will help.</description>
		<content:encoded><![CDATA[<p>@Brett: Hi. Can you try the following:<br />
1. The code must be inserted after the form (so the elements already exist)<br />
2. If the code still doesn&#8217;t work, it can probably be that the code runs before the fields are rendered by your browser. What you can try is to enclose the lines that attacth event in a function like this:</p>
<p>function attachEvents() {<br />
getField(&#8217;select&#8217;,'Enhancement&#8217;).onchange = function() {alert(&#8216;here&#8217;)};<br />
getField(&#8217;select&#8217;,'Enhancement&#8217;).onchange = function() {setVisibility()};<br />
}</p>
<p>and then at the end of script put this function in a _spBodyOnLoadFunctionNames array so it will execute when SharePoint DOM is ready:</p>
<p>_spBodyOnLoadFunctionNames.push(&#8220;attachEvents&#8221;)</p>
<p>Hope this will help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-394</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Mon, 11 Jan 2010 17:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-394</guid>
		<description>For some reason, this isn&#039;t working for me.  I&#039;ve tried adding in some alerts to see what&#039;s happening and those aren&#039;t even triggered.

#   
# 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]  
#         }  
#     }  
# }

#function setVisibility() {
#alert(&#039;here2&#039;);
#}
#getField(&#039;select&#039;,&#039;Enhancement&#039;).onchange = function() {alert(&#039;here&#039;)};
#getField(&#039;select&#039;,&#039;Enhancement&#039;).onchange = function() {setVisibility()};

#

The code generated by Sharepoint is

#
#
#Yes
#No
#

What am I missing?

Thanks!</description>
		<content:encoded><![CDATA[<p>For some reason, this isn&#8217;t working for me.  I&#8217;ve tried adding in some alerts to see what&#8217;s happening and those aren&#8217;t even triggered.</p>
<p>#<br />
# 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>#function setVisibility() {<br />
#alert(&#039;here2&#039;);<br />
#}<br />
#getField(&#039;select&#039;,&#039;Enhancement&#039;).onchange = function() {alert(&#039;here&#039;)};<br />
#getField(&#039;select&#039;,&#039;Enhancement&#039;).onchange = function() {setVisibility()};</p>
<p>#</p>
<p>The code generated by Sharepoint is</p>
<p>#<br />
#<br />
#Yes<br />
#No<br />
#</p>
<p>What am I missing?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Gomiunik</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-334</link>
		<dc:creator>Boris Gomiunik</dc:creator>
		<pubDate>Sun, 25 Oct 2009 23:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-334</guid>
		<description>@Khushi: Thanks for the feedback. Not 100% sure I understand the problem. Perhaps you can try the &quot;onkeyup&quot; event for the textfield. Otherwise the blur event is meant always when the field looses focus. If you submit the form without bluring the field the event doesn&#039;t happen. There is another way to &quot;attach&quot; your own custom javascript to just before the form is submitted, but that is an article I&#039;m preparing.</description>
		<content:encoded><![CDATA[<p>@Khushi: Thanks for the feedback. Not 100% sure I understand the problem. Perhaps you can try the &#8220;onkeyup&#8221; event for the textfield. Otherwise the blur event is meant always when the field looses focus. If you submit the form without bluring the field the event doesn&#8217;t happen. There is another way to &#8220;attach&#8221; your own custom javascript to just before the form is submitted, but that is an article I&#8217;m preparing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Gomiunik</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-333</link>
		<dc:creator>Boris Gomiunik</dc:creator>
		<pubDate>Sun, 25 Oct 2009 22:53:15 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-333</guid>
		<description>Hey, everyone who&#039;s having troubles with lookup fields (especially the ones with more than 20 items). I&#039;ve written a new post explaining Lookup field in a bit more details:

http://www.sharepointboris.net/2009/10/sharepoint-lookup-field-how-does-it-work-and-how-to-add-javascript-event-handler-function-to-it/</description>
		<content:encoded><![CDATA[<p>Hey, everyone who&#8217;s having troubles with lookup fields (especially the ones with more than 20 items). I&#8217;ve written a new post explaining Lookup field in a bit more details:</p>
<p><a href="http://www.sharepointboris.net/2009/10/sharepoint-lookup-field-how-does-it-work-and-how-to-add-javascript-event-handler-function-to-it/" rel="nofollow">http://www.sharepointboris.net/2009/10/sharepoint-lookup-field-how-does-it-work-and-how-to-add-javascript-event-handler-function-to-it/</a></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/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-331</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:23:11 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-331</guid>
		<description>[...] Gomiunik on 26-10-2009       Due to a lot of comments and questions to my last year’s post about Attaching functions to SharePoint form fields concerning especially lookup fields on which the demo was made, I’ve decided to take a deeper [...]</description>
		<content:encoded><![CDATA[<p>[...] Gomiunik on 26-10-2009       Due to a lot of comments and questions to my last year’s post about Attaching functions to SharePoint form fields concerning especially lookup fields on which the demo was made, I’ve decided to take a deeper [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khushi</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-326</link>
		<dc:creator>Khushi</dc:creator>
		<pubDate>Tue, 20 Oct 2009 21:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-326</guid>
		<description>Hi Boris,

 Great article. i did manage to raise onblur event of the sharepoint textfield (say Title). But the problem is blur event is firing only when form is fresh. Fresh means when i am browsing this form in add mode and every fields of the forms is empty. I write something in the SP textfield and as i leave the textbox it fires a blur event which is fine.

 But when i submit the form where other  validators viz. requirefield validator are also placed and validated. I means there is a field location which is set to be validated by required field validator. and let&#039;s say i leave location field empty. its validator raised.

 So, After this blur event of the SP TextField title is not firing. Also would like to mention that AJAX is enabled on this Page.

could please ponder on this problem? 

Thanks &amp; Regards
Khushi</description>
		<content:encoded><![CDATA[<p>Hi Boris,</p>
<p> Great article. i did manage to raise onblur event of the sharepoint textfield (say Title). But the problem is blur event is firing only when form is fresh. Fresh means when i am browsing this form in add mode and every fields of the forms is empty. I write something in the SP textfield and as i leave the textbox it fires a blur event which is fine.</p>
<p> But when i submit the form where other  validators viz. requirefield validator are also placed and validated. I means there is a field location which is set to be validated by required field validator. and let&#8217;s say i leave location field empty. its validator raised.</p>
<p> So, After this blur event of the SP TextField title is not firing. Also would like to mention that AJAX is enabled on this Page.</p>
<p>could please ponder on this problem? </p>
<p>Thanks &amp; Regards<br />
Khushi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-302</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 10 Sep 2009 13:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-302</guid>
		<description>Hi Boris,
First thanks for this excellent article. Even though I am not a programmer, I manage to get it to work, even with 2 different cascading field in the same form.

Unfortunately, just as Mike, I am in front of the &quot;more than 20 items&quot; problem, and I just can&#039;t figure it out with the little knowledge in javascript I have. Would it be possible for you to give a little example to adapt the script from the link you gave ?

thanks</description>
		<content:encoded><![CDATA[<p>Hi Boris,<br />
First thanks for this excellent article. Even though I am not a programmer, I manage to get it to work, even with 2 different cascading field in the same form.</p>
<p>Unfortunately, just as Mike, I am in front of the &#8220;more than 20 items&#8221; problem, and I just can&#8217;t figure it out with the little knowledge in javascript I have. Would it be possible for you to give a little example to adapt the script from the link you gave ?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.sharepointboris.net/2008/04/add-functions-and-events-to-sharepoint-form-fields/comment-page-1/#comment-289</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 10 Aug 2009 21:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://doma.gomiunik.net/?p=106#comment-289</guid>
		<description>Boris,

If you could just guid me how to &quot;adapt&quot; the code for more than 20 items--I would be extremely grateful.   I just can&#039;t figure it out--my javascript is not that strong...

Thx,
-MO</description>
		<content:encoded><![CDATA[<p>Boris,</p>
<p>If you could just guid me how to &#8220;adapt&#8221; the code for more than 20 items&#8211;I would be extremely grateful.   I just can&#8217;t figure it out&#8211;my javascript is not that strong&#8230;</p>
<p>Thx,<br />
-MO</p>
]]></content:encoded>
	</item>
</channel>
</rss>
