473,796 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

popup box 1 time in session

I have a page where users upload pics of there own
I want it to have a popup box that tells them I have now control of the following content
If they hit ok the page loads if the hit cancel or no the page goes to my homepage, aany help or is this even possible?
Thanks you
Jul 23 '05 #1
6 1742
I have this code which does about 90% of what i want

<script>
//specify message to alert
var alertmessage="a dult 18+ images! \n We are not responsible for the
content in this section."
//Alert only once per browser session (0=no, 1=yes)
var once_per_sessio n=1
function get_cookie(Name ) {
var search = Name + "="
var returnvalue = "";
if (document.cooki e.length > 0) {
offset = document.cookie .indexOf(search )
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie .indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie .length;
returnvalue=une scape(document. cookie.substrin g(offset, end))
}
}
return returnvalue;
}
function alertornot(){
if (get_cookie('al erted')==''){
loadalert()
document.cookie ="alerted=ye s"
}
}
function loadalert(){
alert(alertmess age)
}
if (once_per_sessi on==0)
loadalert()
else
alertornot()
</script>

----------------------------------

all this code is missing is a Yes or No option
"aznFETISH" <ne**@aznfetish .com> wrote in message
news:J2******** **********@torn ado.tampabay.rr .com...
I have a page where users upload pics of there own
I want it to have a popup box that tells them I have now control of the
following content
If they hit ok the page loads if the hit cancel or no the page goes to my
homepage, aany help or is this even possible?
Thanks you
Jul 23 '05 #2
In article <Vu************ ******@tornado. tampabay.rr.com >, ne**@aznfetish. com
enlightened us with...

all this code is missing is a Yes or No option


Change alert to confirm and stick in an IF.

if (confirm(messag e))
{
// do something
}
else
{
// do something else
}
--
--
~kaeli~
Is it true that cannibals don't eat clowns because they
taste funny?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
That makes sense but Im still a bit lost new to this javascript

"kaeli" <ti******@NOSPA M.comcast.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...
In article <Vu************ ******@tornado. tampabay.rr.com >,
ne**@aznfetish. com
enlightened us with...

all this code is missing is a Yes or No option


Change alert to confirm and stick in an IF.

if (confirm(messag e))
{
// do something
}
else
{
// do something else
}
--
--
~kaeli~
Is it true that cannibals don't eat clowns because they
taste funny?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
In article <KP************ ******@tornado. tampabay.rr.com >, ne**@aznfetish. com
enlightened us with...
That makes sense but Im still a bit lost new to this javascript


Someone else wrote your other script, too, eh? ;)

Assumes: this function is being loaded in a popup window with the opener as
the page in question. If this is NOT the case and the alert is running right
in the main window, change the word "opener" to the word "window" (no
quotes). I wasn't sure what you meant by 'popup a box'.

function loadalert()
{
if (!confirm(alert message))
{
// they cancelled: go back to home page
opener.location .href = "yourHomePage.h tml";
}
else
{
// load content into opener
opener.location .href="theAdult Content.html";
}
}
--
--
~kaeli~
If a turtle doesn't have a shell, is he homeless or naked?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5
Hi yes I found the script on the web that I posted,
What I need is a popup box as in the litle alert box to load when I go to
the page for the first time in that session. The script I posted does that
but has 1 option an "ok" option I want to have like a Yes or NO option and
if no is hit go back if yes the continue to load that page
Thanks for your help

"kaeli" <ti******@NOSPA M.comcast.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...
In article <KP************ ******@tornado. tampabay.rr.com >,
ne**@aznfetish. com
enlightened us with...
That makes sense but Im still a bit lost new to this javascript


Someone else wrote your other script, too, eh? ;)

Assumes: this function is being loaded in a popup window with the opener
as
the page in question. If this is NOT the case and the alert is running
right
in the main window, change the word "opener" to the word "window" (no
quotes). I wasn't sure what you meant by 'popup a box'.

function loadalert()
{
if (!confirm(alert message))
{
// they cancelled: go back to home page
opener.location .href = "yourHomePage.h tml";
}
else
{
// load content into opener
opener.location .href="theAdult Content.html";
}
}
--
--
~kaeli~
If a turtle doesn't have a shell, is he homeless or naked?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6
In article <3G************ ******@tornado. tampabay.rr.com >, ne**@aznfetish. com
enlightened us with...
Hi yes I found the script on the web that I posted,
What I need is a popup box as in the litle alert box to load when I go to
the page for the first time in that session. The script I posted does that
but has 1 option an "ok" option I want to have like a Yes or NO option and
if no is hit go back if yes the continue to load that page
Thanks for your help


I posted the solution. Replace the function as noted.
--
--
~kaeli~
If the funeral procession is at night, do folks drive with
their lights off?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4727
by: Jimmy Junatas | last post by:
When we open a window (using client-side jscript ie. window.open("/Site/Popup.aspx?...",...)) from Page1.aspx, the called page Popup.aspx does not have access to the Session variables present in Page1.aspx. The IIS Log shows (listed below) shows that the ASP.NET_SessionId cookie is not present in Popup.aspx. The thing is that this mechanism works for 99% of our users. There is this one user that is consistently having this problem. ...
2
6166
by: Joe Molloy | last post by:
Hi, This isn't a mission critical question but I thought I'dl throw it out there for your feedback as it's a bit curious. I have developed a shopping cart for an application I'm working on which is loosely based on the e-commerce example in the quickstarts tutorial. In the cart display I have provided functionality so that when a user clicks on a product name a popup is opened with the full product details displayed.
0
435
by: ChrisB | last post by:
I'm attempting to open a new window from a LinkButton in a DataGrid. I can set a session variable in the ItemCommand event for the LinkButton like so: // this is used to handle the ItemCommand event private void itmCmd(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { string itemGFNo = ""; if (e.CommandName == "EditTask")
1
11591
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
0
1558
by: aiasso | last post by:
Hi All, Need big time help with this one. I'm using Forms Authentication with an ASP.NET (VB.NET) web app, and everything is fine until the client opens a popup window using javascript on the client side. The problem is that when they close the popup window (either closing the window with the X button or with the close method on the java popup, and then go to navigate in the main window again (the one that launched the popup) the...
1
2026
by: Jennyfer J Barco | last post by:
Hello I have a datagrid and a linkbuttom in the datagrid that says Picture, every time I click on the link "Picture" my program opens a popup window showing a picture of the item the selected and information about the item. On the html of the datagrid I have the following: OnItemCommand="Grid_CartCommand" OnItemCreated="DataGrid_ItemCreated". My VB functions are the following: Sub DataGrid_ItemCreated(ByVal Sender As Object, ByVal e As...
15
10100
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the popup has a DataGrid on it and the page.load function DataBinds as you'd expect. I have Code-Behind in C# to emit a call to a JavaScript function which
1
12691
by: gvrajkumar | last post by:
Hi Popup window is opened and after some time session has expired. After session expire, if the user tries to make any actions on the popup page the user is redirected to login.jsp page. What I want is when the user tries to make any actions on the expired popup I want the popup window to be closed and parent window to be refreshed with the login.jsp page. Basically I want identify the popup window.
2
3587
by: VMI | last post by:
I have a LinkButton_search on my Page1.aspx that opens up a popup page called popup.aspx. I do this with LinkButton.Attributes.Add() on the Page_Load of Page1.aspx. How can I add server-side code to LinkButton_search_Click() so that the code in there runs before opening the popup window? The problem is that I fill a Session variable when I click on the button that will then be used in the Page_Load of my Popup window. So basically this is...
2
1804
by: =?Utf-8?B?U3VyZXNoIFJlZGR5?= | last post by:
I am getting a strange problem with IE7 tabs. The web application I am working (developed in ASP.Net, .Net 2.0), will show a popup message with the count down timer 2 minutes before session time out. The count down timer on popup will start with 120 and will be count down to 0 and if the user doesn't click on the Continue button (which is on popup), application logs out and the web page will be shown with login page. If the user clicks...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.