how to find gridview hidden label value from javascripthttp://forums.asp.net/t/1510265.aspx/1?how+to+find+gridview+hidden+label+value+from+javascriptThu, 07 Jan 2010 11:56:37 -050015102653596622http://forums.asp.net/p/1510265/3596622.aspx/1?how+to+find+gridview+hidden+label+value+from+javascripthow to find gridview hidden label value from javascript <p>hi</p> <p>I have a&nbsp;dynamic gridview.I have&nbsp;emp_id in&nbsp;label which is hidden.I want to get&nbsp;emp_id in javascript.&nbsp;</p> 2010-01-04T09:55:05-05:003596640http://forums.asp.net/p/1510265/3596640.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Hi,</p> <p>if you set&nbsp;the label control to visibility=false then it won't get rendered. Use a &lt;asp:HiddenField&gt; control instead.</p> <p>Grz, Kris.&nbsp;</p> 2010-01-04T10:03:10-05:003596682http://forums.asp.net/p/1510265/3596682.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>HI</p> <p>Show ur Gridview (table) markup code from view-source from&nbsp;browser.</p> <p>so that u can get quick solutions here.</p> <p>-----------------------------&nbsp;</p> <p>Happy Coding.</p> 2010-01-04T10:18:27-05:003596728http://forums.asp.net/p/1510265/3596728.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>hi</p> <p>but i want to hide gridview column how&nbsp;can i do&nbsp;that. If i&nbsp;am using&nbsp;template field visible false then again same situation occured.&nbsp;</p> 2010-01-04T10:50:20-05:003596734http://forums.asp.net/p/1510265/3596734.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Hi,</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>mamtagupta</h4> using&nbsp;template field visible false </blockquote> &nbsp; <p></p> <p>As I said before, when you set it to Visible=false, it won't get rendered to the browser. Use a hiddenfield instead or use css to make the column invisible.</p> <p>Grz, Kris.</p> 2010-01-04T10:53:18-05:003596753http://forums.asp.net/p/1510265/3596753.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>hi</p> <p>css can hide a dynamic grid column. If you&nbsp;have that css code please provide me.&nbsp;</p> 2010-01-04T11:06:41-05:003596768http://forums.asp.net/p/1510265/3596768.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Hi,</p> <p>in css create a class like</p> <p>.hideColumn {&nbsp;display:none; }&nbsp;</p> <p>and set it on the column template like <strong>CssClass=&quot;hideColumn&quot;</strong></p> <p>Grz, Kris.</p> 2010-01-04T11:18:05-05:003596821http://forums.asp.net/p/1510265/3596821.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>hi</p> <p>thanks its working.</p> <p>But i have one more problem. first i have find&nbsp;tr tag in javascript. then&nbsp;input tag. I i want to identify&nbsp;input tag through id.</p> <p>How can i do that.&nbsp;</p> 2010-01-04T11:55:18-05:003596874http://forums.asp.net/p/1510265/3596874.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Hi,</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>mamtagupta</h4> thanks its working.</blockquote> &nbsp; <p></p> <p>No problem.</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>mamtagupta</h4> But i have one more problem</blockquote> <p></p> <p>It's best to start a new thread for that and refer to another thread if necessary. Adding on top of resolved questions with new questions makes a thread less transparent.</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>mamtagupta</h4> first i have find&nbsp;tr tag in javascript. then&nbsp;input tag. I i want to identify&nbsp;input tag through id.</blockquote> <p></p> <p>Start a new thread and explain in more detail what you're after, what your rendered code looks like or what code you already have.</p> <p>Grz, Kris.</p> 2010-01-04T12:27:11-05:003598062http://forums.asp.net/p/1510265/3598062.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Hi</p> <p>U can try this:</p> <p>var trObject = document.getElementById(your tr Id);</p> <p>var inputs = trObject.getElementsByTagName(&quot;INPUT&quot;);</p> <p>inputs appear as an array</p> <p>_______________________</p> <p>April</p> <p><a href="http://www.comm100.com/livechat/">http://www.comm100.com/livechat/</a></p> 2010-01-05T02:33:58-05:003598249http://forums.asp.net/p/1510265/3598249.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>hi&nbsp;</p> <p>i get array. But now how i identify different&nbsp;controls with id </p> <p>Example If i have two hidden field in array. How&nbsp;can i find one.</p> <p>Please help me.&nbsp;</p> 2010-01-05T04:27:58-05:003598257http://forums.asp.net/p/1510265/3598257.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>hi&nbsp;</p> <p>it's&nbsp; not new thread. It's same here&nbsp;i&nbsp;am finding gridview row with tr tag. </p> 2010-01-05T04:31:13-05:003598302http://forums.asp.net/p/1510265/3598302.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Have you tried using jQuery?&nbsp; If you haven't you can find any element on the page by a <a href="http://docs.jquery.com/Selectors">selector</a>.&nbsp; So if you want to find a hidden field called hdnField you would do this:</p> <p>&#36;(&quot;#hdnField&quot;).val();</p> <p>That would return the value of the hidden field.<br> </p> 2010-01-05T05:07:55-05:003598323http://forums.asp.net/p/1510265/3598323.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>hi malcolms,</p> <p>I have hidden field in gridview.</p> <p>First i have read &lt;tr&gt; from grid. Then i am reading input tag. I have one checkbox and 2 hidden field&nbsp;in input tag. I want to find one hidden field which is emp_id.</p> <p>Will you please help me.</p> <p>Thanks in advance</p> 2010-01-05T05:25:43-05:003598341http://forums.asp.net/p/1510265/3598341.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Hi,</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>mamtagupta</h4> First i have read &lt;tr&gt; from grid. Then i am reading input tag. I have one checkbox and 2 hidden field&nbsp;in input tag. I want to find one hidden field which is emp_id.</blockquote> &nbsp; <p></p> <p>Can you show us some piece of your generated html? jQuery could indeed help you to find what you're after. I suggest you take a look at its selectors: <a href="http://docs.jquery.com/Selectors">http://docs.jquery.com/Selectors</a>.</p> <p>Grz, Kris.</p> 2010-01-05T05:35:03-05:003598396http://forums.asp.net/p/1510265/3598396.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>hi kris,</p> <p>&lt;TABLE id=ctl00_ContentPlaceHolder1_ctl02_ctl00 style=&quot;TABLE-LAYOUT: auto; WIDTH: 100%; empty-cells: show&quot; cellSpacing=0 rules=cols border=1&gt;<br> &lt;COLGROUP&gt;<br> &lt;COL&gt;<br> &lt;COL&gt;<br> &lt;COL&gt;<br> &lt;COL&gt;<br> &lt;COL&gt;<br> &lt;COL&gt;<br> &lt;COL&gt;<br> &lt;COL&gt;&lt;/COLGROUP&gt;<br> &lt;THEAD&gt;<br> &lt;TR&gt;<br> &lt;TH scope=col UniqueName=&quot;TemplateColumn&quot;&gt;&amp;nbsp;&lt;/TH&gt;<br> &lt;TH style=&quot;DISPLAY: none&quot; scope=col UniqueName=&quot;TemplateColumn1&quot;&gt;&amp;nbsp;&lt;/TH&gt;<br> &lt;TH style=&quot;DISPLAY: none&quot; scope=col UniqueName=&quot;TemplateColumn2&quot;&gt;&amp;nbsp;&lt;/TH&gt;<br> &lt;TH scope=col UniqueName=&quot;TemplateColumn3&quot;&gt;Name&lt;/TH&gt;<br> &lt;TH scope=col UniqueName=&quot;User Name&quot;&gt;User Name&lt;/TH&gt;<br> &lt;TH scope=col UniqueName=&quot;Department&quot;&gt;Department&lt;/TH&gt;<br> &lt;TH scope=col UniqueName=&quot;TemplateColumn4&quot;&gt;Email&lt;/TH&gt;<br> &lt;TH scope=col UniqueName=&quot;Primary Phone&quot;&gt;Primary Phone&lt;/TH&gt;<br> &lt;TH scope=col UniqueName=&quot;Status&quot;&gt;Status&lt;/TH&gt;<br> &lt;TH scope=col UniqueName=&quot;Admin&quot;&gt;Admin&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;<br> &lt;TBODY&gt;<br> &lt;TR id=ctl00_ContentPlaceHolder1_ctl02_ctl00__0&gt;<br> &lt;TD&gt;</p> <p>&lt;INPUT id=ctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_hgtechchk type=checkbox CHECKED name=ctl00&#36;ContentPlaceHolder1&#36;ctl02&#36;ctl00&#36;ctl04&#36;hgtechchk _rfddecoratedID=&quot;_rfdSkinnedctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_hgtechchk&quot;&gt;&lt;LABEL id=_rfdSkinnedctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_hgtechchk for=ctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_hgtechchk unselectable=&quot;on&quot;&gt;&amp;nbsp;&lt;/LABEL&gt;</p> <p>&lt;/TD&gt;<br> &lt;TD style=&quot;DISPLAY: none&quot;&gt;&lt;INPUT id=ctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_hbEmployee_Id type=hidden value=e0d44211-bd49-4a60-8906-26a14d032374 name=ctl00&#36;ContentPlaceHolder1&#36;ctl02&#36;ctl00&#36;ctl04&#36;hbEmployee_Id&gt;&lt;/TD&gt;</p> <p><br> &lt;TD style=&quot;DISPLAY: none&quot;&gt;&lt;INPUT id=ctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_hbReport_to type=hidden name=ctl00&#36;ContentPlaceHolder1&#36;ctl02&#36;ctl00&#36;ctl04&#36;hbReport_to&gt;&lt;/TD&gt;<br> </p> <p>&lt;TD&gt;&lt;A id=ctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_lnkNameEMPLOYEE_ID onclick=&quot; Done('e0d44211-bd49-4a60-8906-26a14d032374','vikas');&quot; href=&quot;javascript:__doPostBack('ctl00&#36;ContentPlaceHolder1&#36;ctl02&#36;ctl00&#36;ctl04&#36;lnkNameEMPLOYEE_ID','')&quot;&gt;vikas&lt;/A&gt;&lt;/TD&gt;<br> </p> <p>&lt;TD&gt;vikas&lt;/TD&gt;<br> &lt;TD&gt;&amp;nbsp;&lt;/TD&gt;<br> </p> <p>&lt;TD&gt;&lt;A id=ctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_lnkEmail href=&quot;javascript:__doPostBack('ctl00&#36;ContentPlaceHolder1&#36;ctl02&#36;ctl00&#36;ctl04&#36;lnkEmail','')&quot;&gt;mg@yahoo.com&lt;/A&gt;&lt;/TD&gt;<br> </p> <p>&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;<br> </p> <p>&lt;TD&gt;False&lt;/TD&gt;<br> </p> <p>&lt;TD&gt;False&lt;/TD&gt;</p> <p>&lt;/TR&gt;<br> </p> <p>&lt;/TBODY&gt;</p> <p>&lt;/TABLE&gt;</p> <p><strong>this is grid html. and i want to find </strong></p> <p>&lt;TD style=&quot;DISPLAY: none&quot;&gt;&lt;INPUT id=ctl00_ContentPlaceHolder1_ctl02_ctl00_ctl04_hbEmployee_Id type=hidden value=e0d44211-bd49-4a60-8906-26a14d032374 name=ctl00&#36;ContentPlaceHolder1&#36;ctl02&#36;ctl00&#36;ctl04&#36;hbEmployee_Id&gt;&lt;/TD&gt;</p> <p>this&nbsp;value 'e0d44211-bd49-4a60-8906-26a14d032374'</p> <p>Please help me.</p> <p>Thanks in advance</p> 2010-01-05T06:10:52-05:003598440http://forums.asp.net/p/1510265/3598440.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Try this jQuery.&nbsp; It will only search for a field that ends with hbEmployee_Id:</p> <p>&#36;(&quot;input[id&#36;=hbEmployee_Id]&quot;).val()</p> <p>The &#36;= section of the selector works well in these scenario's where the id is changed thanks to master pages for example.<br> </p> 2010-01-05T06:32:05-05:003598475http://forums.asp.net/p/1510265/3598475.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>&nbsp;hi malcolms,</p> <p>i have this javascript method</p> <pre class="prettyprint">function CheckOtherIsCheckedByGVID() { var Parent = document.getElementById('ctl00_ContentPlaceHolder1_ctl02'); var itemchk = Parent.getElementsByTagName('TR'); var val_ret=''; for(var i=0;i&lt;itemchk.length;i&#43;&#43;) { var itemch=itemchk[i].getElementsByTagName('INPUT'); for(var k=0;k&lt;itemch.length;k&#43;&#43;) { if(itemch[k].type==&quot;checkbox&quot;) { if(itemch[k].checked) { <strong> var emp= itemchk(&quot;input[id$=hbEmployee_Id]&quot;).val();</strong> alert(emp); } } } } }</pre> <p>will you please help&nbsp;because I don't know how can i use this.<br> </p> 2010-01-05T06:49:56-05:003598564http://forums.asp.net/p/1510265/3598564.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>Well that piece of JavaScript will return the value of the hidden field.&nbsp; So if you only have one hidden field named that, that piece of code will find it without looping through each row in the table.&nbsp; Make sense?<br> </p> 2010-01-05T07:21:07-05:003598572http://forums.asp.net/p/1510265/3598572.aspx/1?Re+how+to+find+gridview+hidden+label+value+from+javascriptRe: how to find gridview hidden label value from javascript <p>hi malcolms</p> <p>i have multiple rows and multiple hidden&nbsp;fields that why i have problem to&nbsp;find&nbsp;hidden field&nbsp;</p> 2010-01-05T07:25:03-05:00