iweb99
08-25-2003, 11:18 AM
Ok been trying to figure this one out and getting no where…
This is the gist of what I’m trying to do…
I have a page (part of a web dev companies site) that provides users with online quotes, they select the type of site they want (from a combo box) and enter how many pages they want the site to be (in a textbox).
Then they click on a link which calls some JavaScript code which first validates their input then goes about calculating a quote, this quote (so far so good) is then output into a ready formatted html page using <Span> and the innerHTML command.
This is when I hit problems, I open a new window;
var msgWindow = window.open("../fees/printquote.htm", "msgWindow");
and then using some <span> tags I have embedded in printquote.htm I alter the content to suit the quote they have requested. For example ;
crtPtr = msgWindow.document.getElementById("domainCost");
crtPtr.innerHTML = "";
crtPtr.innerHTML = domain_fee;
This is where I get the error message “crtPtr is null or not an object”, meaning for some reason once the window is open I can no longer access it or its objects. The page still opens but the new content is not inserted.
The weird thing is this code works perfectly offline (even tried it on two different machines with different version of IE), so what I cant understand is why would it work offline but not online?
Hope someone can help me with this!
This is the gist of what I’m trying to do…
I have a page (part of a web dev companies site) that provides users with online quotes, they select the type of site they want (from a combo box) and enter how many pages they want the site to be (in a textbox).
Then they click on a link which calls some JavaScript code which first validates their input then goes about calculating a quote, this quote (so far so good) is then output into a ready formatted html page using <Span> and the innerHTML command.
This is when I hit problems, I open a new window;
var msgWindow = window.open("../fees/printquote.htm", "msgWindow");
and then using some <span> tags I have embedded in printquote.htm I alter the content to suit the quote they have requested. For example ;
crtPtr = msgWindow.document.getElementById("domainCost");
crtPtr.innerHTML = "";
crtPtr.innerHTML = domain_fee;
This is where I get the error message “crtPtr is null or not an object”, meaning for some reason once the window is open I can no longer access it or its objects. The page still opens but the new content is not inserted.
The weird thing is this code works perfectly offline (even tried it on two different machines with different version of IE), so what I cant understand is why would it work offline but not online?
Hope someone can help me with this!