View Full Version : simple .value function need help asap

01-04-2007, 05:55 PM
hi i have got the following function

it takes 3 strings, what is being copied where it is going and a number which must be placed on the end of what is being copied

function swapvalues(from, num,to){
var a=from+num;

what it should do:

basically add from and num together

so the inputs will be like this from = "Template" num = "0" ect..

i want it to add the from and num together to make Template0

then get the swap the value of the destination with template0

so to.value=Template0.value

although this does not seem to work with the a.value thing please help!!

01-04-2007, 08:36 PM
You are creating a string here: var a=from+num;

that is not an object reference

You need to do something like



01-05-2007, 11:07 AM
thanks man, i have fixed the problem now with your help! it had been bugging me for a while:thumbsup: