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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

array to hidden variable

Status
Not open for further replies.

kann

Programmer
Feb 16, 2000
25
US
hai,<br>&nbsp;&nbsp;&nbsp;&nbsp;I am new to javascript.i have 6 forms(looping over to &lt;br&gt;create 6 forms) in a page there is a common text field(&quot;deliverydt&quot;).all i need to capture the sixdatefiled in &lt;br&gt;the form and pass it on to the next page by hidden field.&lt;br&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;i am not sure how to capture the all &lt;br&gt;the date field in a array&nbsp;&nbsp;and list to single hidden field.<br><br>can u help me?<br><br>tom<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;
 
Dear kann,<br><br>If I understand your question here is a possible solution.<br><br>&lt;script language=javascript&gt;<br>&lt;!--<br>function onSubmit(){<br><br>&nbsp;&nbsp;var dt_array = new Array();<br>&nbsp;&nbsp;for( index=0; index&lt;6; index++)<br>&nbsp;&nbsp;&nbsp;&nbsp;dt_array[index] = new String(document.all(&quot;deliverydt&quot;, index).value);<br><br>&nbsp;&nbsp;// now load the hidden variable with a 'pipe' delimited <br>&nbsp;&nbsp;// string of all the dates<br>&nbsp;&nbsp;document.all(&quot;dateArray&quot;).value = dt_array.join(&quot;¦&quot;);<br>}<br><br>//--&gt;<br>&lt;/script&gt;<br>&lt;input type=&quot;hidden&quot; name=&quot;dateArray&quot; id=&quot;arrayProxy&quot; value=&quot;0&quot;&gt;<br><br>To work in Nutscrap it would have to changes slightly but I don't understand what you mean by the following:<br><br>&gt;&gt;i have 6 forms(looping over to &lt;br&gt;create 6 forms) <br><br>So I didn't address the Nutscrap code issue.<br><br>Good luck<br>-pete
 
hai,<br>&nbsp;&nbsp;&nbsp;Thanks for ur help,everything is work great.<br><br>i Really appreciate ur help<br><br>kann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top