Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-26-2010, 10:28 PM   PM User | #1
jlsjonas
New to the CF scene

 
Join Date: Sep 2010
Location: Belgium
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jlsjonas is an unknown quantity at this point
Netscape jquery UI confirmation dialog instead of confirm()

Hello coders,

a friend of me asked for a little help,
he had a confirm() dialog in javascript to confirm a deletion
however he wants to use jqueryui dialog modal-confirmation

the problem is that we can't get it working
I hope that you guys can help

'working' script with confirm():
Code:
<script type="text/javascript" >
function deleterow(id){
if (confirm('Ben je zeker dat je deze gebruiker wilt verwijderen?')) {
$.post('quit.php', {id: +id, ajax: 'true' },
function(){
$("."+id).fadeOut("slow");
$(".message").fadeIn("slow");
$(".message").delay(2000).fadeOut(1000);
});
}

}
</script>
above code works, but uses a simple confirm() dialog

several attempts in making it work with JQUI failed

one of the attempts:
Code:
	<script type="text/javascript" >
	function deleteconfirmed(id){
		document.write("Hello World!");
$.post('quit.php', {id: +id, ajax: 'true' },
function(){
$("."+id).fadeOut("slow");
$(".message").fadeIn("slow");
$(".message").delay(2000).fadeOut(1000);
});
}
$(function() {
		$( "#dialog-confirm" ).dialog({
			autoOpen: false,
			resizable: false,
			height:140,
			modal: true,
			buttons: {
				"Delete item": function() {
					deleteconfirmed();
					$( this ).dialog( "close" );
				},
				Cancel: function() {
					$( this ).dialog( "close" );
				}
			}
		});

				function deleterow(id){
				$('#dialog-confirm').dialog('open');
				return false;
				}
});
</script>
Please help us out,
Best Regards, JLS Jonas
jlsjonas is offline   Reply With Quote
Old 09-27-2010, 12:18 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,105
Thanks: 197
Thanked 2,422 Times in 2,400 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Suggest you post this in the jQuery (Javascript Frameworks) section of this forum. Ask a mod to move you over.
Philip M is offline   Reply With Quote
Old 09-27-2010, 07:45 PM   PM User | #3
jlsjonas
New to the CF scene

 
Join Date: Sep 2010
Location: Belgium
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jlsjonas is an unknown quantity at this point
Quote:
Originally Posted by Philip M View Post
Suggest you post this in the jQuery (Javascript Frameworks) section of this forum. Ask a mod to move you over.
mod, could you move the topic over? ty

& note to others: I'd like it with the jQUI, not another type

Ty
jlsjonas is offline   Reply With Quote
Old 09-27-2010, 07:58 PM   PM User | #4
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,827
Thanks: 9
Thanked 685 Times in 679 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
I think you'll find it has already been moved...

Can't immediately see anything wrong with your code. What happens - just nothing, no dialog?
SB65 is offline   Reply With Quote
Reply

Bookmarks

Tags
confirm, confirm(), delete, dialog, jquery ui

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:45 AM.


Advertisement
Log in to turn off these ads.