EdNerd
02-23-2010, 04:50 PM
I posted this in the general JavaScript forum, but wasn't getting any reply, so on the chance I was in the wrong place, I am re-posting the question here.
I'm looking at creating a set of customer contact forms. I'd like to be able to have a main contact page where the visitor fills in general info like name and such, and then clicks a link to get into the specific area form he needs.
I've done VB programming and used it to manipulate an IE document object. I've explored JavaScript and managed to code one or two IF functions. I'm wondering if I open the linked form in a new window, can I use JS to pull the info from the first window and insert it into the new window? Seems like it would be easy, but I'm having some trouble.
I have included only the bits of code that seem to be the problem (since everything else was okay before i started fiddling with it!)
In my parent window, I have
<form name="TopInfo">
and
<input size="30" name="txtConName">
In the child window, I have
<body background="graphics/fiebkgnd.jpg" onload="GetInfo()">
and
function GetInfo(){
varName = window.opener.document.TopInfo.txtConName.value
alert(varName)
}
I'm working in PageBreeze (free). Every time I save, it tells me that window.opener.document is not an object.
When I open the parent page in IE, fill in the text box, and click the link, the child page opens but again I get a JavaScript error.
Is there any help for this?
Ed
I'm looking at creating a set of customer contact forms. I'd like to be able to have a main contact page where the visitor fills in general info like name and such, and then clicks a link to get into the specific area form he needs.
I've done VB programming and used it to manipulate an IE document object. I've explored JavaScript and managed to code one or two IF functions. I'm wondering if I open the linked form in a new window, can I use JS to pull the info from the first window and insert it into the new window? Seems like it would be easy, but I'm having some trouble.
I have included only the bits of code that seem to be the problem (since everything else was okay before i started fiddling with it!)
In my parent window, I have
<form name="TopInfo">
and
<input size="30" name="txtConName">
In the child window, I have
<body background="graphics/fiebkgnd.jpg" onload="GetInfo()">
and
function GetInfo(){
varName = window.opener.document.TopInfo.txtConName.value
alert(varName)
}
I'm working in PageBreeze (free). Every time I save, it tells me that window.opener.document is not an object.
When I open the parent page in IE, fill in the text box, and click the link, the child page opens but again I get a JavaScript error.
Is there any help for this?
Ed