I have a problem that seems like it should be easy, yet I don't quite have the answer. I have an html page with a number of textboxes for input. When the user clicks a button, a javascript routine performs calculations and displays the output. This works fine. I'm using a button to create a "printer friendly" version of the output in a new html page. I'm trying to access the calculated values and put them in textboxes on the new form without luck.
Say Page1.htm is displaying the output with a button for the printer friendly page (Page2.htm). In my javascript for Page2.htm I have in initPage2 function that is called from the onload of Page2. I'm using one javascript file for both Page1.htm and Page2.htm (Page.js). My code looks something like this:
What's wrong with the getElementsByNa me?
Any suggestions would be appreciated!
Bob
Say Page1.htm is displaying the output with a button for the printer friendly page (Page2.htm). In my javascript for Page2.htm I have in initPage2 function that is called from the onload of Page2. I'm using one javascript file for both Page1.htm and Page2.htm (Page.js). My code looks something like this:
Code:
function initPage2() {
document.Page2.txtTest2.value=document.getElementsByName('txtTest1').value; // Doesn't work, but
document.Page2.txtTest2.value="99"; // Works fine
}
Any suggestions would be appreciated!
Bob
Comment