![]() ![]() |
Apr 4 2008, 12:10 AM
Post
#1
|
|
![]() oxymoronman Group: ++Member Posts: 118 Joined: 19-September 05 From: Greensburg, PA Member No.: 2,893 ![]() Bomb Darts Champion! Hexxagon Champion! Breakout Champion! |
Hello everyone,
I am somewhat new to web development. I'm decent at being able to create websites with sql databases and so on, but not so much of the front end with the javascript. I have code from http://www.jtricks.com/javascript/window/box.html that enables me to have a pop-up within my page, displaying it is not the problem, its trying to close the pop-up that is stumping me and others who tried to help me. I am using this as a box for logging in and adding comments and so on. I first need to run some php to add their information to their session and then I want to automatically close the pop-up and refresh the page they are on. So I have tried everything from javascript alerts that use CODE java script:void(0); or the function that they specify to use as a onclick CODE return show_hide_box(this, 200, 270, '2px solid') or even CODE window.close() I have used these with form onclick= , echo "<script>...</script>" but it only seems to work when you wrap it in an anchor for a link. Is there a reason that anyone sees that I am messing up, or is just the code made that it can not be closed unless clicked on a link? -------------------- |
|
|
|
Apr 5 2008, 02:27 PM
Post
#2
|
|
|
SuperNova III Member Group: Support Team Posts: 2,141 Joined: 2-November 02 From: Toronto Member No.: 302 ![]() |
it's using the HREF value of the link to look for the popup. you should change the show_hide function to this:
# function show_hide_box(popupID, width, height, borderStyle) # { # var boxdiv = document.getElementById(popupID); # # if (boxdiv != null) # { this could break other parts but checking the firefox error console will give you a clue. post back with the results if you want. |
|
|
|
Apr 6 2008, 08:22 AM
Post
#3
|
|
![]() oxymoronman Group: ++Member Posts: 118 Joined: 19-September 05 From: Greensburg, PA Member No.: 2,893 ![]() Bomb Darts Champion! Hexxagon Champion! Breakout Champion! |
Thanks for the suggestion, it was actually able to do what I was looking for, had to modify it a bit to get everything in place, but me and a friend we able to patch it enough that it worked for us. Thanks for the help!
-------------------- |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 25th May 2013 - 08:19 PM |