If you change your naming convention just slightly, such that the
second set of fields uses a predictable prefix/suffix, then you can
just use a single array to iterate over. Without looking into how to
handle radio buttons, checkboxes, and selects, the code would be
something like:

$A( 
["cAddress2","cCity","cHousingType","cState","cStreetName","cStreetNum","cStreetType","cYearsAtAddr","cZip","cZip4"]
).each( function( controlID ){
  $('co_' + controlID ).value = $F( controlID ); // this only works
for input of type=text and textareas
});

The code for the other form element types would involve fetching the
element, determining what it is, then using an appropriate method to
copy the value over.

-justin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to