If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Simple Onclick Popup Window

First of all i'd like to say i am not an expert in these types of things so pardon me if the wording for certain things is off. So i have a button on my homepage. I want the button (When clicked) to create a ''popup'' window with my website terms and conditions in it. ''I agree'' and ''Exit'' should be the two main options the person has. When '''I agree'' is clicked they are redirected to a certain URL. When ''Exit'' is clicked the ''popup'' window goes away. Will someone help me with this i would be beyond grateful
I envision it to be like this

That is perfect! you just made my day. How do i make this work with an existing button? Here is the code for the button i am currently using:
<input type="button" onclick="document.location = ('http://www.google.com/');" value="Redirect"> and how do i get my full terms of conditions displayed in the box with a navbar?

EDIT: I am having some trouble implementing this on a regular button. I have 3 buttons on my website each of the 3 need to have this same code so if any of the 3 are clicked the popon will appear

EDIT 2: Is there anyway to make your popon look like a popup? I am trying to use this code but it just does not look good. The box is very unappealing.. Is there any way you could code it to make it look kind of like what i pictured above? I would be willing to give you a few bucks for it. and also the location of the box when clicked is crazy sometimes it shows up on the very far left of the screen where no one thinks to look

Again, you can style/position the div content (fonts etc.) using css. But you cannot expect others to do all your work for you. As was pointed out earlier, this forum is not a free coding service.

Finally, and once again, it is essential/mandatory that you validate the user's agreement to the terms on the server. Otherwise it can simply be bypassed, and is consequently useless. The user can also just View Source to see the url of the redirect page, and go directly to it. In any case, why do you want a lot of legal gobbledegook with lengthy terms and conditions which realistically you cannot enforce? I have the idea that you do not entirely understand all the dimensions of what you are doing.

Or are we talking about an "adult" or a gambling site?

Last edited by Philip M; 03-18-2013 at 10:54 AM.

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Again, you can style/position the div content (fonts etc.) using css. But you cannot expect others to do all your work for you. As was pointed out earlier, this forum is not a free coding service.

Finally, and once again, it is essential/mandatory that you validate the user's agreement to the terms on the server. Otherwise it can simply be bypassed, and is consequently useless. The user can also just View Source to see the url of the redirect page, and go directly to it. In any case, why do you want a lot of legal gobbledegook with lengthy terms and conditions which realistically you cannot enforce? I have the idea that you do not entirely understand all the dimensions of what you are doing.

Or are we talking about an "adult" or a gambling site?

First let me say thank you for your help it is greatly appreciated. I have 3 buttons all horizontally aligned on my website. Above each of them is a choice of selection of 3 different ways to use my site. Lets use Alpha, Beta, Ceta as examples. Under all 3 there is text that describes each of them as well as a button
These buttons when on clicked i would like to activate my term of service agreement where they will need to agree to continue using my website. I understand i should have it validated a system and i do have that in mind but i want to leave that for a later time. For now however i just want the 3 buttons to activate on click my tos and an option to agree or close (Which you have all graciously helped me with )
The problem i am having with the code is it is almost impossible for me to change each buttons coding without moving their location completely either way up or way down where they are suppose to be. (All 3 were perfectly aligned horizontally but when i implement the code to each button they go in totally wacky positions. One of them was so far below the Alpha's text i could barely see it. While the other was way above where it should beI need a simple code that will allow me to implement it on to EACH button code individually
My current button codes is

Basially if you could not tell all i did was replace the normal button code with the code from old pendant....
That may not seem right but to my knowledge of coding (Which is minimal) that is the best i could come up with. I would really appretiate it if i got a code that i could just add on to my current button code
FROM THIS
<input type="button" onclick="document.location = ('http://www.google.com/');" value="ceta">

TO THIS
<input type="button" onclick="activate the popon;" value="ceta">

You seem to have ignored my remark - "Again, you can style/position the div content (fonts etc.) using css". But you cannot expect others to do all your work for you. As was pointed out earlier, this forum is not a free coding service. You should make an effort and learn a little css.

And the guy's name is Old Pedant, not Old Pendant.

Last edited by Philip M; 03-18-2013 at 06:03 PM.

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

I just implemented the code and it worked perfectly. I thought i would have to put it on each button individually but it turns out i didn't need to. Well it's working brilliantly now only problem i have is the location of the popon when clicked. It shows up in some outrageous positions. How do i make it show up in the exact center of the webpage?
Right now the code is

Code:

position: absolute;

i tried

PHP Code:

position: center;

PHP Code:

position: right;

PHP Code:

position: left;

They all fail to please and some of them

PHP Code:

position: left;

do not show up at all because it is cut off by the button

PHP Code:

position: absolute;

is the best i have got but even that is way off page and unattractive

I have tried this with some success. It moved to the bottom of the page and it is somewhat easier to see.. Although i do not understand why even when i change the px number it does not move.

You seem to have ignored my remark - "Again, you can style/position the div content (fonts etc.) using css". But you cannot expect others to do all your work for you. As was pointed out earlier, this forum is not a free coding service. You should make an effort and learn a little css.

Those values define the position of the popon. That position is fixed and cannot "show up in some outrageous positions".

I think you are the one who may not understand. I already tried that and it did not work changing the number before px does nothing. I thought i made that clear. Now it may be something preventing it from doing what it would normally do (maybe coding?) but i told you it is not moving no matter what it changes to so i don't think i was doing anything wrong
Also i do not expect you to do anything for me but i do think a certain amount of help is what a forum like this is for don't you agree.

But I would have thought that anyone of moderate intelligence could adjust the absolute values in

I'll search around Google and see what pops up. But thanks for the help though