Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

force a popup

Status
Not open for further replies.

ralphtrent

Programmer
Jun 2, 2003
958
US
Does anyone have an idea of how to force a popup? I need to ask the user, in a popup, if they would like to take a survey. The Google tool bar keeps blocking it.

Thanks
 
You could also use an aboluteley positioned DIV. Over the page. Using Javascript you could change the style to display:none or display:box to show or hide the div.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I think vacunita's way will work best, can you please a full example.

Thanks.
 
cLFlaVA, thats what I have done and I am coming up short. I was hoping to see an example to see what I am doing wrong. If you look at my profile and other post, you will see that I do much legwork before even coming here to post question, or I have simply supplied examples without questioning others previous efforts.

Thanks.
 
ok. if you need help with a JavaScript issue, I suggest asking in the JS forum (forum216). i must warn you, however, (as i'm sure you know) that this "solution" will only work if people have javascript enabled.

it's not the approach i'd take.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
something like this should work:

Code:
<div id="mypopup" class="showpopup"> 
This is a popup
<input type=button value="Close" 

onClick="document.getElementById('mypopup').className='hidepopup'">"
</div>

You have your Class showpopup that styles the div when it is to be shown. and a class hidepopup that only has display:none, to hide.

Using javascript you can change the class of the DIV. Of course as CFlava pointed out , Javascript will need to be enabled in the browser for this to work.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Why not have it shown by default and use Javascript to turn it off rather than on?

If you then make the link within the popup jump to another page and again use javascript to 'return false' if its clicked. So if javascript is disabled the link is followed to the same page with no 'popup' on it. If javascript IS enabled the link does nothing other than an action specified in your script.

You'll then have something that will work in both a javascript and non javascript environment.

<honk>*:O)</honk>
Designease Ltd. - polyprop folders, ring binders and creative presentation ideas
Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
The problem is I am trying to have the popup load when the page loads (using OnLoad in the <body> tag). Popup blokers to not seemto block popup windows if the request for a popup window was done via a user action.

Thanks
 
With my method you don;t need the onload event. it will load with the page. And when you click close it will dissapear until you refresh the page.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top