OnFocus function does not workhttp://forums.asp.net/t/1809751.aspx/1?OnFocus+function+does+not+workFri, 01 Jun 2012 11:57:43 -040018097515007297http://forums.asp.net/p/1809751/5007297.aspx/1?OnFocus+function+does+not+workOnFocus function does not work <pre class="prettyprint">&lt;asp:HiddenField ID=&quot;hdnBlockRefresh&quot; runat=&quot;server&quot;/&gt; &lt;script type=&quot;text/javascript&quot;&gt; function BlockGridRefresh() { document.getElementById('hdnBlockRefresh').Value = '0'; alert(document.getElementById('hdnBlockRefresh').value); } function GridRefresh() { document.getElementById('hdnBlockRefresh').Value = '1'; } &lt;/script&gt;</pre> <p>And&nbsp;</p> <p>txtTechnician.Attributes.Add(&quot;onfocus&quot;, &quot;BlockGridRefresh()&quot;); <br> txtTechnician.Attributes.Add(&quot;onblur&quot;, &quot;GridRefresh()&quot;);</p> <p>I have a griView with many textboxes with the same id and i want to set the hiddenField value when is no focus one of them.</p> <p>If a pun alert in&nbsp;BlockGridRefresh is displayed over and over again...and my hiddenField value is not set. Why this is happening?</p> <p>TY</p> <p></p> 2012-06-01T08:57:21-04:005007307http://forums.asp.net/p/1809751/5007307.aspx/1?Re+OnFocus+function+does+not+workRe: OnFocus function does not work <p>try using using clientID fro example</p> <pre class="prettyprint">document.getElementById('&lt;%=hdnBlockRefresh.ClientID%&gt;').Value = '0';</pre> <pre class="prettyprint"><span class="pun"><br /></span></pre> 2012-06-01T09:07:53-04:005007308http://forums.asp.net/p/1809751/5007308.aspx/1?Re+OnFocus+function+does+not+workRe: OnFocus function does not work <p>Hi,</p> <p>try to get hidden field control like this.....</p> <p>&nbsp;document.getElementById(&quot;hiddenfieldID&quot;)</p> <p>(or)</p> <p>&nbsp;document.getElementById(&quot;&lt;%=hiddenfieldID.ClientID%&gt;&quot;)</p> <p></p> 2012-06-01T09:08:12-04:005007378http://forums.asp.net/p/1809751/5007378.aspx/1?Re+OnFocus+function+does+not+workRe: OnFocus function does not work <p>Still doesnt work :(</p> 2012-06-01T09:43:26-04:005007548http://forums.asp.net/p/1809751/5007548.aspx/1?Re+OnFocus+function+does+not+workRe: OnFocus function does not work <p>Hi,</p> <p>U have used .Value but javascript is case sensitive U need to use .value ( lowercase 'v').</p> <pre class="prettyprint">document.getElementById('hdnBlockRefresh').value = '0';</pre> <p>and make sure the Id name is same as client ID</p> <p>:)<br> <br> </p> 2012-06-01T11:08:59-04:005007564http://forums.asp.net/p/1809751/5007564.aspx/1?Re+OnFocus+function+does+not+workRe: OnFocus function does not work <p>hi</p> <p>it may help you</p> <p><a href="http://csharpektroncmssql.blogspot.in/2012/04/dynamic-css-styles-in-aspnet.html" rel="nofollow" target="_blank">http://csharpektroncmssql.<wbr>blogspot.in/2012/04/dynamic-<wbr>css-styles-in-aspnet.html</a></p> 2012-06-01T11:14:54-04:005007569http://forums.asp.net/p/1809751/5007569.aspx/1?Re+OnFocus+function+does+not+workRe: OnFocus function does not work <p>Hai</p> <p><a href="http://stackoverflow.com/questions/7756740/focus-does-not-seem-to-work-after-onblur">http://stackoverflow.com/questions/7756740/focus-does-not-seem-to-work-after-onblur</a></p> <p><a href="http://www.daniweb.com/web-development/php/threads/409537/onfocusfunction-in-generated-html-doesnt-work">http://www.daniweb.com/web-development/php/threads/409537/onfocusfunction-in-generated-html-doesnt-work</a></p> <p>thank u</p> 2012-06-01T11:18:13-04:005007643http://forums.asp.net/p/1809751/5007643.aspx/1?Re+OnFocus+function+does+not+workRe: OnFocus function does not work <p>Hi,</p> <p>I think until you submit the form, you can't access the Hidden field variable value!</p> <p>What you can do is, assign the value to&nbsp;a temp variable and access it!</p> <p>Hope it helps u...</p> 2012-06-01T11:57:43-04:00