7 replies
by ebob
You have a couple of choices.
I think the "best" bet is in the pop-up itself you have a form Input element with something like "onClick(window.close())".
You could put something similar in the "source" window, but this will be confusing for your users. If you really want to do this, then make a note of the name you gave the pop-up in the "window.open('name',...)" statement. Then in the source window, you can just "window.close('name')".
by judge dread
by jay eckles
window.close() will close the window. If the window was not opened via Javascript (which it sounds like it was in your case), then IE might ask the user if he wants to close the window. You can use this bit of Javascript in virtually any input element: button, hyperlink, checkbox, radio button, etc. Anything that has an action event associated with it will work.
For example:
or
Close Window
Good luck.
Jay Eckles
by judge dread
JayEckles: Here is the code. What code do I use and where di I insert it?
order=window.open("","orderWindow","toolbar=no,width=550,height=500,menubar=yes,resize=yes,")
with (order.document) {
write("")
write("Customer's Rental Invoice-Amount Due!")
write("")
write("")
write("
Thank you for your business, "+custname+"
")
write("
Please remember, we will reserve the vehicle of your choice-if you call at least 2 hours in advance.")
write("
Listed below is your address and the total invoice amount of your auto rental.
")
write("
We accept cash, major Credit Cards, and checks drawn on local banks only!
")
write("
Street Address: "+ address+"
")
write("City: "+ city+"
")
write("State: "+ state+"
")
write("Zip Code: "+ zipcode+"
")
write("Customer Type: "+ custype +"
")
write("Beginning Odometer Reading: "+ startodread+"
")
write("Ending Odometer Reading: "+ endodread+"
")
write("Total Miles Driven: "+ totalread+"
")
write("Days Rented: "+ daysrented +"
")
write("Total Mileage Charge:$ "+ totmilechg+"
")
write("Total Usage Charge :$ "+ totdaychg+"
")
write("Total Rental Charge :$ "+ grandtotal+"
")
write("
")
write("")
(close)
}
by jay eckles
I replied to you via private email. Also, here's the link to the Netscape Javascript Guide that I promised:
http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm
Here also is the Netscape Javascript Reference, better if you just have a quick question and need to look something up:
http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm
Good luck.
Jay
by judge dread
by judge dread
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending