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

Arrays

Status
Not open for further replies.

iao

Programmer
Feb 23, 2001
111
US
I recently asked a similar question a while back but didn't provide enough information for everyone.

The code below is an example of what my display form looks like. What I would like to do is this: whenever someone changes a radio button value (from Yes to NO, and vice versa), I would like to dump ALL changed values into a Javascript 2-dimensional array. Then, when the user presses the submit button, I would like to insert the items from the array into a new form (the act_page.cfm page).

This is needed so I can tell what values changed so I can run a SQL query to update the database for the changed values. I can't find worthwhile help/ideas from any of the javascript manauls I have. Any help is much appreciated. Thanks!

<FORM ACTION=&quot;act_page.cfm&quot; NAME=&quot;InputForm&quot; METHOD=&quot;post&quot;>
<TABLE WIDTH=&quot;500&quot; ALIGN=&quot;center&quot;>
<INPUT TYPE=&quot;submit&quot; VALUE=&quot;Submit&quot;>  
<INPUT TYPE=&quot;Reset&quot; VALUE=&quot;Cancel&quot;><BR><BR>
</TABLE>
<STRONG>Select which work orders should appear on the timesheet.</STRONG><BR><BR>
<TABLE>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; NAME=&quot;Row1&quot; VALUE=&quot;T, 10001, 1st Disaster&quot; ONCHANGE=&quot;&quot;>Yes </TD>
<TD WIDTH=&quot;75&quot;><INPUT TYPE=&quot;radio&quot; NAME=&quot;Row1&quot; VALUE=&quot;F, 10001, 1st Disaster&quot; ONCHANGE=&quot;&quot; CHECKED>No </TD>
<TD WIDTH=&quot;75&quot;>10001</TD>
<TD>1st Disaster 2001</TD>
</TR>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; NAME=&quot;Row2&quot; VALUE=&quot;T, 20000, OTHER MISC-STRTS&quot; ONCHANGE=&quot;&quot;>Yes </TD>
<TD WIDTH=&quot;75&quot;><INPUT TYPE=&quot;radio&quot; NAME=&quot;Row2&quot; VALUE=&quot;F, 20000, OTHER MISC-STRTS&quot; CHECKED>No </TD>
<TD WIDTH=&quot;75&quot;>20000</TD>
<TD>OTHER MISC-STRTS</TD>
</TR>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; NAME=&quot;Row3&quot; VALUE=&quot;T, 20111, PAYROLL ADJUSTMENTS&quot; ONCHANGE=&quot;&quot;>Yes </TD>
<TD WIDTH=&quot;75&quot;><INPUT TYPE=&quot;radio&quot; NAME=&quot;Row3&quot; VALUE=&quot;F, 20111, PAYROLL ADJUSTMENTS&quot; CHECKED>No </TD>
<TD WIDTH=&quot;75&quot;>20111</TD>
<TD>PAYROLL ADJUSTMENTS</TD>
</TR>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; NAME=&quot;Row4&quot; VALUE=&quot;T, 20300, PATCH PERM-HOT-FOR WATER&quot; ONCHANGE=&quot;&quot;>Yes </TD>
<TD WIDTH=&quot;75&quot;><INPUT TYPE=&quot;radio&quot; NAME=&quot;Row4&quot; VALUE=&quot;F, 20300, PATCH PERM-HOT-FOR WATER&quot; CHECKED>No </TD>
<TD WIDTH=&quot;75&quot;>20300</TD>
<TD>PATCH PERM-HOT-FOR WATER</TD>
</TR>
</TABLE>
</FORM>
 
sorry, I don't know what you mean by &quot;ALL data&quot; is there data in elements not in this code?
and why do you want to use a 2D array? Klae

You're only as good as your last answer!
 
Well, honestly, I was originally thinking that I needed to go the route of a 2-D array, but I am beginning to think that is not the best solution.

In the above example, if the user changes only one of the radio buttons from NO (false) to YES (true), I only want that value to be inserted into the array (nothing else). That value would be the specific value for the particular row number. If the user changes three of the radio buttons, I only want those 3 values inserted into the array.

The real problem that I just can't seem to get around is this: if I put the information into a Javascript array, I can't figure out how to dump the values from the array into a URL. I must be not looking in the right places because I can't see any documentation on this anywhere.

Does that make any sense? If not, I guess I'm hopeless.
 
Have you got any server-side scripting available? Klae

You're only as good as your last answer!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top