You would make an AJAX call to your server.

'Delete': function() {
     var myID = SET YOUR ID HERE;
     $.post('delete.php', {id:myID}, function(data) {
          // script is done and a response is returned
          // close the dialog box
          $(this).dialog('close');
     });
 },

On Apr 30, 11:44 am, "[email protected]" <[email protected]>
wrote:
> Hi,
> Iam trying to make list of records from db with PHP. Each record have
> got its own delete icon (image with link to jQuery confirm dialog). I
> think that I solved the problem how to send id of record to dialog
> but:
> How can i run a delete script (PHP) after click on button in dialog ?
> I want to change the url with adding some GET variable so i can delete
> record from DB. Or any other solution would be very usefull.
>
> Please Help
>
> code:
>
> <script type="text/javascript">
>         $(function() {
>
>                         $("#dialog-delete").dialog({
>                                 autoOpen: false,
>                                 bgiframe: true,
>                                 resizable: false,
>                                 width: 400,
>                                 modal: true,
>                                 overlay: {
>                                         backgroundColor: '#000',
>                                         opacity: 0.5
>                                 },
>                                 buttons: {
>                                         'Delete': function() {
> //////////////////////////////////////////////////////////////////////////////
> here i need help how to run PHP script or change url
> ///////////////////////////////////////////////////////////////////////////////
>                                                 $(this).dialog('close');
>                                         },
>                                         'Cancel': function() {
>                                                 $(this).dialog('close');
>                                         }
>                                 }
>                         });
>
>              $([<?php echo $recordIDs ?>]).each(function() {
>                 var num = this;
>
>                 $('#dialog_link_' + num).click(function() {
>                         $('#dialog-delete').dialog('open');
>                         });
>         });
>         });
> </script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to