you can use $ .post () or $ .ajax () from your dialog, for example:
$( "#dialog" ).dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, buttons: { "Save": function() { var type = $("#type option:selected").val(); $.post("/projects/{{project.slug}}/", {type:type}, function(data) { alert(data);// ---> data is what you return from the server }, 'html'); }, "Close": function(){ $(this).dialog('close'); } } });
just point your select id tag to ...... to make it easier to pull the value. also get rid of the enter button, since now you will have a save button from the dialog box.
Ziad el-jayyousi
source share