sonicsnail
Technical User
Hi. I'm creating a phone-number page for text-messaging from.
I have
var JohnSmith = "0123456789,";
var PeteJones = "0223456789,";
var PaulSmith = "0333456789,";
var AllContacts = John + Pete + Paul;
etc etc..
I have a function that fires the numbers into my textarea.. (sometimes I have to put quite a lot of the contacts in at one time, so I can have
onClick="putNumber(John);"
onClick="putNumber(Pete);"
or even
onClick="putNumber(AllContacts);" (I have the commas in the variables already!)
---Here's my Problem ----
I now want to have a 2nd function that adds the NAMES (not their assigned numbers to ANOTHER text area... so I can visually confirm who's numbers have been added to the textarea.
Ideally I'd like to put something like
onClick="PutName(John);"
BUT - of course it'll put John's number, not his name. I suppose I could do it as PutName("John"
; but that falls over when I put PutName("AllContacts"
.
Hopefully someone can give some advice on how to get round this...
thanks,
Pete.
I have
var JohnSmith = "0123456789,";
var PeteJones = "0223456789,";
var PaulSmith = "0333456789,";
var AllContacts = John + Pete + Paul;
etc etc..
I have a function that fires the numbers into my textarea.. (sometimes I have to put quite a lot of the contacts in at one time, so I can have
onClick="putNumber(John);"
onClick="putNumber(Pete);"
or even
onClick="putNumber(AllContacts);" (I have the commas in the variables already!)
---Here's my Problem ----
I now want to have a 2nd function that adds the NAMES (not their assigned numbers to ANOTHER text area... so I can visually confirm who's numbers have been added to the textarea.
Ideally I'd like to put something like
onClick="PutName(John);"
BUT - of course it'll put John's number, not his name. I suppose I could do it as PutName("John"
Hopefully someone can give some advice on how to get round this...
thanks,
Pete.