Click to See Complete Forum and Search --> : How do I pass variables in JavaScript


SeanPaul72
08-06-2003, 05:12 PM
I have designed a form that requests an address. With this request there is a checkbox labelled "use this address for the coborrower's address" this check box has a value of "yes" when checked.

If this box is checked, I need to populate the co-borrower's address with the info from the original adress fields.

here is an example of the code that checks if the "include address" box is checked

if(document.lion1003.cobor.checked)
{ then populate the coborrower's address fields with the same info

And for the address fields I have the following variable:


document.lion1003.L57
document.lion1003.L58
document.lion1003.L59

etc.

So I need to take the above variables and populate the co-borrower's address field, which are labeled:document.lion1003.L57b
document.lion1003.L58b
document.lion1003.L59b

etc.

This should be simple . . . I think, but I do not know how to do it.
Can you help?


Thanks

pyro
08-06-2003, 09:47 PM
Perhaps this:

document.lion1003.L57b.value = document.lion1003.L57.value;
document.lion1003.L58b.value = document.lion1003.L58.value;
document.lion1003.L59b.value = document.lion1003.L59.value;

tsheff
08-06-2003, 10:51 PM
Do you know java?
Try passing the variables into the function you call.