Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2010
    Location
    Belgium
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,013
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Suggest you post this in the jQuery (Javascript Frameworks) section of this forum. Ask a mod to move you over.

  • #3
    New to the CF scene
    Join Date
    Sep 2010
    Location
    Belgium
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,955
    Thanks
    9
    Thanked 726 Times in 720 Posts
    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?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •