Basically I have these 2 functions. Each being called on a different page.
The first page calls function prestr when user clicks a hyperlink and another function updateaddr_to is called in the pop up menu that appears after clicking the hyperlink mentioned earlier.
How is it possible for me to pass the value of textval from prestr to updateaddr_to?
I am thinking of declaring textval as a global variable such that it can be used in the updateaddr_to function. However, it doesn't work.
Guess I have to call function prestr again in updateaddr_to. However, I doubt it can be done, since document.replyauthor.to_email.value will generate an error...
Declare the variable outside the function and then use the variable without the var keywork inside the function, that will update the global function.
Example:
<i> </i><script type="text/javascript"> <!-- var Example = ""; function Bla(){ Example = "Test"; } Bla(); window.alert(Example); //--> </script>
I am developing something similar to a email system.
In this case, I need the first function prestr( ) to retrive existing text from a given textbox and the other function function updateaddr_to( ) to combine this existing text with an array of addresses.
If you can recall the Yahoo! email system, this is how you select the email address of the recipients.
You can type some email addresses in the textbox and click on the address book to add on some more addresses.
What I need to do now is to transfer the exsiting text in the textbox to the second function function updateaddr_to( ), such that I can combine this text with the email addons from the address book, before I output the entire string back to the text box.
I hope you can understand what I mean.
Please take a look at this if you find me unclear.