I have a form that contains address fields for an applicant and a co-
applicant. I would like to add a button that allows the user to copy
the information from the applicant's address into the co-applicant's.
Most of the field are text, but there are a couple of select boxes as
well.

I started out with an array of the names for each, then tried to
iterate through them. Here is the code:

function copyApplicantAddr() {
        var appVars =
["cAddress2","cCity","cHousingType","cState","cStreetName","cStreetNum","cStreetType","cYearsAtAddr","cZip","cZip4"];
        var coappVars =
["coAddress2","coCity","coHousingType","coState","coStreetName","coStreetNum","coStreetType","coYearsAtAddr","coZip","coZip4"];
        $(coappVars).each(function(e, index){e.value = $
(appVars[index]).value});
}

I know my $(appVars[index]) statement is wrong, but I don't know how
to accomplish this through prototype.

Anyone have any insight? Thanks!
--~--~---------~--~----~------------~-------~--~----~
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