Click to See Complete Forum and Search --> : Pop up window with Yes/No button


julieths
September 21st, 2006, 05:06 AM
Hi Gurus,

I have currently working on a web application where one of the requirement upon submitting a form, a pop up window is to appear asking some confirmation from the user and user have to click either the "Yes" or "No" button.

I know in javascript there is a confirm() method where user can either click "OK" or "Cancel" button.

But what the user wants is the "Yes " and "No" button, please advise how should I go about doing this.

Thanks and Regards,
Julie

PeejAvery
September 21st, 2006, 08:47 AM
Well, you can use VBScript's MsgBox function. The problem with that is compatibility. It is only IE compatible.

Take a look here (http://www.devguru.com/technologies/vbscript/QuickRef/msgbox.html).

szpilman
October 6th, 2006, 12:33 PM
when u do this

if(confirm('are u sure')){ //yes will return value true or 1
do this
}
else //this is when no is clicked
{
do this
}

actually u can do it in this way as well
a = confirm('are u sure?');
if(a) //mean yes or true
{
//do this when yes
}
else{
//do this when no
}

//

have a nice try :)

PeejAvery
October 6th, 2006, 01:12 PM
szpilman, Once again, you misunderstand the question.

julieths wants the buttons to say "Yes" or "No". You are using the regular example of "Ok" or "Cancel".

Please don't attempt to power post. It kind of seems like you are attempting to just get your post number up. I hope this is not the case.

Take care.

szpilman
October 7th, 2006, 09:06 AM
@julieth..
may be u can try it by creating a new window pop-up from javascript.
that new window can be controlled from ur current page.

try to understand this code please ...
function dirtypop()
{
var generator=window.open('','name','height=400,width=500');

generator.document.write('<html><head><title>Popup</title>');
generator.document.write('<link rel="stylesheet" href="style.css">');
generator.document.write('</head><body>');
generator.document.write('<p>This page was generated by
the main window.</p>');
generator.document.write('<p><a href="javascript:self.close()">
Close</a> the popup.</p>');
generator.document.write('</body></html>');
generator.document.close();
}

the parent form that call this new window in JavaScript is called
opener

have a nice try :) ..

PeejAvery
October 7th, 2006, 02:53 PM
szpilman, Please stop posting irrelevant posts. If you don't understand, don't post. I already supplied the answer, and even clarified to you what was originally desired.

szpilman
October 8th, 2006, 08:01 AM
peace ..
just wanna try to help.
i admit the i misunderstood the first...
but i dont think my second answer was irrelevant ...
i think it give a clue dude..
anyway
sorry :)
try to be cool dude :)