Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Yes/No Popup window

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  1and1.com free hosting -- any good?  
Author Message
jstucklex

External


Since: Jul 14, 2003
Posts: 1188



(Msg. 1) Posted: Fri Oct 10, 2003 8:59 pm
Post subject: Yes/No Popup window
Archived from groups: alt>www>webmaster (more info?)

All,

I have something a little different here 0 but I'm sure you guys can
help me out.

I need to open a popup window - and get the response. The window will
be something like:

"Warning - This will delete all items in your database."
"Are you sure you want to do this?"

With Yes and No pushbuttons.

Then I need to get the results back in the window which called the popup
(using PHP).

Basically - this is an "Admin" screen - so it's not available to the
general public (protected directory).

I know I could do it by opening one window in the browser with the
information, then have it go to another window. However, I'd much
rather do it with a popup, similar to one to enter your password when
accessing a protected directory.

Does anyone have any snippets to show how to do this?

TIA.




--

To reply, delete the 'x' from my email
Jerry Stuckle,
JDS Computer Training Corp.
jstucklex RemoveThis @attglobal.net
Member of Independent Computer Consultants Association - www.icca.org

 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
user104

External


Since: Jun 28, 2003
Posts: 1662



(Msg. 2) Posted: Sat Oct 11, 2003 2:20 am
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jerry Stuckle" <jstucklex RemoveThis @attglobal.net> wrote in message
news:3F872BAC.57C5@attglobal.net...
 > All,
 >
 > I have something a little different here 0 but I'm sure you guys can
 > help me out.
 >
 > I need to open a popup window - and get the response. The window will
 > be something like:
 >
 > "Warning - This will delete all items in your database."
 > "Are you sure you want to do this?"
 >
 > With Yes and No pushbuttons.
 >
 > Then I need to get the results back in the window which called the popup
 > (using PHP).
 >
 > Basically - this is an "Admin" screen - so it's not available to the
 > general public (protected directory).
 >
 > I know I could do it by opening one window in the browser with the
 > information, then have it go to another window. However, I'd much
 > rather do it with a popup, similar to one to enter your password when
 > accessing a protected directory.
 >
 > Does anyone have any snippets to show how to do this?

I do a similar thing on one of my sites. It's not a pop-up as such, it's
just a webpage that says "are you sure you want to delete this" with two
buttons, "yes" and "no".

The page is two forms, each with a submit button. When the answer is
posted, the output is processed accordingly.

I can't show you the script because it is way too specific to my site, but
perhaps you should just think about the page and yes/no form buttons option.

This is the code for the buttons:

<input type="submit" value="Yes">
<input type="submit" value="No">

If the user clicks "Yes" it posts back to itself and runs the code to delete
the files.

If the user clicks "No" they get taken back to the previous page. I use
javascript for this in the form tag (yes I know!) thus:

action="javascript:history.go(-1);"

I have the quotes escaped, but didn't show it here for clarity.
--
Charles Sweeney
<a style='text-decoration: underline;' href="http://www.CharlesSweeney.com" target="_blank">www.CharlesSweeney.com</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
gvanwilgen

External


Since: Oct 11, 2003
Posts: 2



(Msg. 3) Posted: Sat Oct 11, 2003 4:24 am
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jerry Stuckle" <jstucklex.RemoveThis@attglobal.net> wrote in message
news:3F872BAC.57C5@attglobal.net...
 > All,
 >
 > I have something a little different here 0 but I'm sure you guys can
 > help me out.
 >
 > I need to open a popup window - and get the response. The window will
 > be something like:
 >
 > "Warning - This will delete all items in your database."
 > "Are you sure you want to do this?"
 >
 > With Yes and No pushbuttons.
 >
 > Then I need to get the results back in the window which called the popup
 > (using PHP).
 >
 > Basically - this is an "Admin" screen - so it's not available to the
 > general public (protected directory).
 >
 > I know I could do it by opening one window in the browser with the
 > information, then have it go to another window. However, I'd much
 > rather do it with a popup, similar to one to enter your password when
 > accessing a protected directory.
 >
 > Does anyone have any snippets to show how to do this?

I suppose it could be done with JavaScript, for example:

<FORM NAME="frmDelete" ACTION="delete.php">
....
....
</FORM>
<SCRIPT>
if (confirm("Are you sure?"))
frmDelete.submit()
</SCRIPT>

Gerard van Wilgen
--
<a style='text-decoration: underline;' href="http://www.majstro.com" target="_blank">www.majstro.com</a> (On-line translation dictionary / Enreta tradukvortaro)
<a style='text-decoration: underline;' href="http://www.travlang.com/Ergane" target="_blank">www.travlang.com/Ergane</a> (Free translation dictionary for Windows / Senpaga
tradukvortaro por Windows)<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
davidvb2

External


Since: Sep 25, 2003
Posts: 106



(Msg. 4) Posted: Sat Oct 11, 2003 12:05 pm
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jerry Stuckle wrote:

 > All,
 >
 > I have something a little different here 0 but I'm sure you guys can
 > help me out.
 >
 > I need to open a popup window - and get the response. The window will
 > be something like:
 >
 > "Warning - This will delete all items in your database."
 > "Are you sure you want to do this?"
 >
 > With Yes and No pushbuttons.
 >
 > Then I need to get the results back in the window which called the popup
 > (using PHP).
 >
 > Basically - this is an "Admin" screen - so it's not available to the
 > general public (protected directory).
 >
 > I know I could do it by opening one window in the browser with the
 > information, then have it go to another window. However, I'd much
 > rather do it with a popup, similar to one to enter your password when
 > accessing a protected directory.
 >
 > Does anyone have any snippets to show how to do this?

OK, going with the popup for a minute, you should be able to use the
form's target attribute (transitional DTD only) to point the popup back
to the parent page.

The only problem with just having:
<form action="delete.php" method="post" target="_parent">
<input type="submit" value="Yes"><br>
<input type="submit" value="No">
</form>

Is that you would lose any other variables in delete.php. You can get
around this by either making those variables session variables, so that
they remain available, or if the popup is loaded from a form:

<!-- form in initial page to open popup -->
<form action="confirm.php" method="post" target="popupname">
<input type="hidden" name="blah" value="blah">
etc
<input type="submit" value="Delete">
</form>

And then:
<!-- form in popup -->
<form action="delete.php" method="post" target="_parent">
<?php

foreach ($_POST as $key => $var) {
echo "<input type=\"hidden\" name=\"" . $key . "\" value=\"" . $var
.. "\">";
}
?>
<input type="radio" name="confirmation" value="Yes"><br>
<input type="radio" name="confirmation" value="No" checked="checked">
<input type="submit" name="go" value="Proceed">
</form>

The similar thing can be done with a get. However, this is a less secure
method as it outputs your variables to the page (twice, even though they
are hidden) and so someone could maliciously use them. I don't know how
important this is for your page, and using the $_POST makes it more
difficult for these variables to be then fiddled with and put back into
your form, but this certainly falls into the hack category. I would
recommend using a session and making everything session variables. There
are plenty of tutes out there, and some fairly good ones at
<a style='text-decoration: underline;' href="http://www.phpgeek.com" target="_blank">http://www.phpgeek.com</a> and <a style='text-decoration: underline;' href="http://www.phpbuilder.com" target="_blank">http://www.phpbuilder.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
usemyonlinefor

External


Since: Sep 20, 2003
Posts: 49



(Msg. 5) Posted: Sat Oct 11, 2003 10:29 pm
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

--
Yeah, I guess you're right.

 > Top posting can make things confusing.

  >> What's wrong with top posting?
"Jerry Stuckle" <jstucklex.TakeThisOut@attglobal.net> wrote
 > All,
 >
 > I have something a little different here 0 but I'm sure you guys can
 > help me out.
 >
 > I need to open a popup window - and get the response. The window will
 > be something like:
 >
 > "Warning - This will delete all items in your database."
 > "Are you sure you want to do this?"
 >
 > With Yes and No pushbuttons.
 >
 > Then I need to get the results back in the window which called the popup
 > (using PHP).
 >
 > Basically - this is an "Admin" screen - so it's not available to the
 > general public (protected directory).
 >
 > I know I could do it by opening one window in the browser with the
 > information, then have it go to another window. However, I'd much
 > rather do it with a popup, similar to one to enter your password when
 > accessing a protected directory.
 >
 > Does anyone have any snippets to show how to do this?
 >
 > TIA.
 >

This is one, found another command that uses
opener.document.outputForm.msgLine.value = "hello"
that can refer to the parent window.

Be a good use for my text buttons from last week...
This one below uses window.showModalDialog instead of window.open

Herc


<html>
<head>
<title>Parent</title>

<script language = JavaScript>

function doopen() {
localvar = 7
document.form1.textbox.value = window.showModalDialog("dlg.html", localvar)
}

</script>

</head>

<body>

<form name = form1>
<br>
<input type=button value="Open window" onclick="doopen()">
<br>
<input type=text name="textbox" size = 30>
</form>
</body>

</html>



************************************


<html>
<head>
<title>Dialog</title>

<script language = JavaScript>

function okbutton() {
//alert("here") use dialogArguments to read the parameter
window.returnValue = "true"
window.close()
}

function cancelbutton() {
window.returnValue = "false"
window.close()
}

</script>

</head>

<body>
<form name = form1>
<br>
<input type=button value=" OK " onclick="okbutton()">

<input type=button value="Cancel" onclick="cancelbutton()">
</form>
</body>

</html><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
usenet5

External


Since: Sep 21, 2003
Posts: 9



(Msg. 6) Posted: Sun Oct 12, 2003 1:05 pm
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jerry Stuckle" <jstucklex.TakeThisOut@attglobal.net> wrote in message
news:3F872BAC.57C5@attglobal.net...
 > All,
 >
 > I have something a little different here 0 but I'm sure you guys can
 > help me out.
 >
 > I need to open a popup window - and get the response. The window will
 > be something like:
 >
 > "Warning - This will delete all items in your database."
 > "Are you sure you want to do this?"
 >
 > With Yes and No pushbuttons.
 >
 > Then I need to get the results back in the window which called the popup
 > (using PHP).
 >
 > Basically - this is an "Admin" screen - so it's not available to the
 > general public (protected directory).
 >
 > I know I could do it by opening one window in the browser with the
 > information, then have it go to another window. However, I'd much
 > rather do it with a popup, similar to one to enter your password when
 > accessing a protected directory.
 >
 > Does anyone have any snippets to show how to do this?
 >
 > TIA.
 >

I do it like this. In <head></head> you would have this:

<SCRIPT type="text/javascript">
function confirmDelete(delMake, delID) {
if (confirm("Are you sure you want to delete \n'" + delMake + "' from the
database?")) {
document.location = "myfile.php or asp?action=delete&ID=" + delID;
}
}
</SCRIPT>

Then this to trigger the delete:

<input type="radio" name="action"
onClick="confirmDelete('<%=dbVar1%>','<%=dbVar2%>');" value="<%=dbVarID%>"
title="Delete <%=dbVar1%>">

Hope this helps

Peter<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
usenet5

External


Since: Sep 21, 2003
Posts: 9



(Msg. 7) Posted: Sun Oct 12, 2003 3:14 pm
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jerry Stuckle" <jstucklex.TakeThisOut@attglobal.net> wrote in message
news:3F872BAC.57C5@attglobal.net...
 > All,
 >
 > I have something a little different here 0 but I'm sure you guys can
 > help me out.
 >
 > I need to open a popup window - and get the response. The window will
 > be something like:
 >
 > "Warning - This will delete all items in your database."
 > "Are you sure you want to do this?"
 >
 > With Yes and No pushbuttons.
 >
 > Then I need to get the results back in the window which called the popup
 > (using PHP).
 >
 > Basically - this is an "Admin" screen - so it's not available to the
 > general public (protected directory).
 >
 > I know I could do it by opening one window in the browser with the
 > information, then have it go to another window. However, I'd much
 > rather do it with a popup, similar to one to enter your password when
 > accessing a protected directory.
 >
 > Does anyone have any snippets to show how to do this?
 >
 > TIA.
 >
2nd Try:

I do it like this. In <head></head> you would have this:

<SCRIPT type="text/javascript">
function confirmDelete(delMake, delID) {
if (confirm("Are you sure you want to delete \n'" + delMake + "' from the
database?")) {
document.location = "myfile.php or asp?action=delete&ID=" + delID;
}
}
</SCRIPT>

Then this to trigger the delete:

<input type="radio" name="action"
onClick="confirmDelete('<%=dbVar1%>','<%=dbVar2%>');" value="<%=dbVarID%>"
title="Delete <%=dbVar1%>">

Hope this helps

Peter<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
jstucklex

External


Since: Jul 14, 2003
Posts: 1188



(Msg. 8) Posted: Thu Oct 30, 2003 1:04 pm
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

All,

Thanks for the tips. I now have it working with Javascript - and it's
doing great.

Once I get things more completed, I'll be posting the URL for a review.

Thanks again - I knew I could count on y'all!

Jerry

--

To reply, delete the 'x' from my email
Jerry Stuckle,
JDS Computer Training Corp.
jstucklex.RemoveThis@attglobal.net
Member of Independent Computer Consultants Association - www.icca.org
 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
alex2

External


Since: Aug 12, 2003
Posts: 50



(Msg. 9) Posted: Fri Oct 31, 2003 12:47 pm
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Charles Sweeney" <me.TakeThisOut@charlessweeney.com> wrote in message news:<bm7bbs$jsm40$1@ID-162618.news.uni-berlin.de>...
 > "Jerry Stuckle" <jstucklex.TakeThisOut@attglobal.net> wrote in message
 > news:3F872BAC.57C5@attglobal.net...
  > > All,
  > >
  > > I have something a little different here 0 but I'm sure you guys can
  > > help me out.
  > >
  > > I need to open a popup window - and get the response. The window will
  > > be something like:
  > >
  > > "Warning - This will delete all items in your database."
  > > "Are you sure you want to do this?"
  > >
  > > With Yes and No pushbuttons.
  > >
  > > Then I need to get the results back in the window which called the popup
  > > (using PHP).
  > >
  > > Basically - this is an "Admin" screen - so it's not available to the
  > > general public (protected directory).
  > >
  > > I know I could do it by opening one window in the browser with the
  > > information, then have it go to another window. However, I'd much
  > > rather do it with a popup, similar to one to enter your password when
  > > accessing a protected directory.
  > >
  > > Does anyone have any snippets to show how to do this?
 >
 > I do a similar thing on one of my sites. It's not a pop-up as such, it's
 > just a webpage that says "are you sure you want to delete this" with two
 > buttons, "yes" and "no".
 >
 > The page is two forms, each with a submit button. When the answer is
 > posted, the output is processed accordingly.
 >
 > I can't show you the script because it is way too specific to my site, but
 > perhaps you should just think about the page and yes/no form buttons option.
 >
 > This is the code for the buttons:
 >
 > <input type="submit" value="Yes">
 > <input type="submit" value="No">
 >
 > If the user clicks "Yes" it posts back to itself and runs the code to delete
 > the files.
 >
 > If the user clicks "No" they get taken back to the previous page. I use
 > javascript for this in the form tag (yes I know!) thus:
 >
 > action="javascript:history.go(-1);"
 >
 > I have the quotes escaped, but didn't show it here for clarity.

I agree with Charles. It might be easier to have an intermediary
website asking Yes or No then an actual pop-up window. Also, we have
some vendor software that does these pop-ups, and programs like Pop-up
Killer stop the windows from appearing. Leades to lots of problems
and can cause a confirmation when you didn't mean one.

Just an FYI,

Alex.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
jstucklex

External


Since: Jul 14, 2003
Posts: 1188



(Msg. 10) Posted: Fri Oct 31, 2003 6:54 pm
Post subject: Re: Yes/No Popup window [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alex wrote:
 >
 >
 > I agree with Charles. It might be easier to have an intermediary
 > website asking Yes or No then an actual pop-up window. Also, we have
 > some vendor software that does these pop-ups, and programs like Pop-up
 > Killer stop the windows from appearing. Leades to lots of problems
 > and can cause a confirmation when you didn't mean one.
 >
 > Just an FYI,
 >
 > Alex.


Alex,

As I said in my first message - this goes into some admin pages which
are not available to the general public. Access is controlled, so this
is not a problem.

I have the popups running - and they're working just like I need.

Thanks.

--

To reply, delete the 'x' from my email
Jerry Stuckle,
JDS Computer Training Corp.
jstucklex.RemoveThis@attglobal.net
Member of Independent Computer Consultants Association - <a style='text-decoration: underline;' href="http://www.icca.org" target="_blank">www.icca.org</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Yes/No Popup window 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Help please with pictures in new window - I am using hover buttons on my used car web site, when clicked on a new full page appears with a photo of a car in the top left side of the screen, I have seen other sites which have the picture appear in its own smaller box and still enables you to see....

How do I set focus of another window? - Hi All, I have some external links that I want to open in a separate browser window and I give it a name 'newwin' for example. The new window opens behind the current window. How do I set focus of that window? Any help would be appreciated. S.

open a window - Im looking for a perl/cgi script that when called will open a new window with out tool bar ect, I know theres a lot of javascript's that will do the job but for this one I can't us java. Unless any one can get this working with out = using " and..

Can I meta refresh to a new browser window? - Hi Is there anyway to get a meta refresh to do so in an new browser window? e.g. This code forwards this user after 8 seconds... <meta http-equiv=refresh content=8;url=http://www.auction-air.com/index.html> Is it possible to do so but in a new w...
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]