$( '#loginform2' ).bind( function(){ var path = "{$urlpath}frontend/shoppingcart_ajax.php"; $.get( path, $(this).serialize(), function( data ){ data = jQuery.parseJSON( data ); if( data.status == 1 ) { $('rightmenu').html( data.rightmenu ); $('#loginform2').fadeOut("fast", function(){ $(this).remove(); }); } else { $('#loginform2 input[type=password]').val( '' ); $( '#errorlogin2' ).dialog({ autoOpen: true, resizable: false, height:200, width:330, modal: true, show: "blind", hide: "blind", buttons: { "OK": function() { $( this ).dialog( "close" ); }, } }); } }); return false; });