Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieve hidden value from dynamically loaded table

Status
Not open for further replies.

cylly

Programmer
Oct 17, 2002
23
CA
In script I am trying to do this, name = info.children[?].children['tName'].value . How can I determine what ? is supposed to be? It will be a different number depending on the table row selected from a previous screen.
My table looks like this.
<TABLE id=&quot;mytable&quot; border=1>
<TR name='tablerow1'>
<pr:iterator results=&quot;tableLayout&quot;>
<b>
<TH><pr:field name=&quot;column_screen_txt&quot;/> </TH>
</b>
</pr:iterator>
</TR>

Any suggestions would be greatly appreciated.

<pr:iterator results=&quot;tableData&quot; >
<TR onClick=&quot;highlightTR('#c9cc99','cc3333',this);&quot;>
<pr:fieldIterator>
<TD><pr:field /></TD>
</pr:fieldIterator>

<TD>
<input type=hidden name=tName value=<%= request.getParameter(&quot;tName&quot;) %> >
<input type=hidden name=tDesc value=<%= request.getParameter(&quot;tDesc&quot;) %> >
<input type=hidden name=tNum value=<%= request.getParameter(&quot;tNum&quot;) %> >
<input type=hidden name=key1Value value=&quot;<pr:field name=&quot;first_ky_typcd&quot;/>&quot;>
</TD>
</TR>
</pr:iterator>
</TABLE>
 
Why don't you retrieve the value strait into javascript (without hiding it)?

<script>
var tName=&quot;<%=request(&quot;tName&quot;)%>&quot;
</script> -----------------------------------------------------------------
[pc] Be nice. It's only doing what you tell it to do.
mikewolf@tst-us.com
 
That worked! I didn't know you could do that. Thanks for your help. I am still very new at javascript but I am plugging away at it.
 
That worked for the request.getParameter values. How can I get the value for key1Value?
 
i have no idea, this is a complete guess, but i hope it helps:
Code:
<script>
var key1Value = &quot;<pr:field name='first_ky_typcd'/>&quot;;
</script>
hope it helps
&quot;Those who dare to fail miserably can achieve greatly.&quot; - Robert F. Kennedy
So true..
 
I tried that already. It didn't work.
 
You would retrieve the value the same way. The question I have is how are you setting the value on the original page? What are you trying to do with it?

<input type=hidden name=key1Value value=&quot;<pr:field name=&quot;first_ky_typcd&quot;/>&quot;>


key1Value = &quot;<%=key1Value%>&quot; -----------------------------------------------------------------
[pc] Be nice. It's only doing what you tell it to do.
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top