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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirmation Dialog?

Status
Not open for further replies.

JurkMonkey

Programmer
Nov 23, 2004
1,731
CA
I'm looking to pop up a window similar to the one used on facebook which confirms a users actions.

"Are you sure you want to delete?" - yes, no

I'm not sure how this is done but I'd really rather not use JavaScript if I can avoid it. Anyone know how to do this?

 
Why not use Javascript? It saves on time and bandwidth since it is client-side.

Steve Davis

NOTE: This sig does not include any reference to voting, stars, or marking posts as helpful as doing so is cause for membership termination.
 
Without Javascript your going to basically need to insert a new page between the page that your use is interacting with and whatever page comes next. This new "middle" page could simply have a nice little box on it with your confirmation message and OK/Cancel buttons. Pressing either button would take them to the last page, at which point you can determine if they pressed cancel (redirect back to the first page without saving) or Ok (save changes).

I can think of at least 3 different ways that I would prefer, but unfortunately they all require Javascript.


 
[off topic]

Hey Tarwn...cool little App, your Graffiti thing. But I especially like the comment spam in your forum.

I killed it off on my website with a little bit of PHP
Code:
<?PHP  
		$digit1 = rand(1,10);
		$digit2 = rand(1,10);
		$answer= $digit1 + $digit2;
		
		echo($digit1. " + " . $digit2 . " = ");
		
		?> 
          <input name="result" type="text" id="result" size="2" maxlength="2">
	      <input name="answer" type="hidden" value="<?php echo($answer);?>">
I'm sure you'll figure out how to slot it in if it is of any use.

Steve Davis

NOTE: This sig does not include any reference to voting, stars, or marking posts as helpful as doing so is cause for membership termination.
 
I guess JavaScript is the way to go. I'm just concerned if JavaScript is not enabled that the function will just continue anyways...
 
how many people don't have Jscript enabled...seriously. You could always test for it...of course popping a javascript "You must have Javascript" alert might be tricky :)

Steve Davis

NOTE: This sig does not include any reference to voting, stars, or marking posts as helpful as doing so is cause for membership termination.
 
Is this something you can easily do with Ajax?

Anyone have a good sample?
 
yes. you could easily do it with ajax as ajax is just javascript so far as the client side is concerned.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top