jquery-ui-dialog

Validate JQuery UI modal form within another form in MVC 4

五迷三道 提交于 2019-12-04 14:29:57
问题 I have a form in MVC 4 which contains several fields and, depending on the value of a combo, I need to open a modal dialog form and load into that one 3 additional fields that will impact against the same entity that I'm creating/editing in the main form. For this modal dialog I'm using the one from jQuery UI. Now, what I need to do is to validate (Required) the fields within the modal dialog in order to allow the user to retain the entered values which will be submited later by the main form

How do I open a jQuery UI Dialog from my c# code behind?

六月ゝ 毕业季﹏ 提交于 2019-12-04 12:11:31
I am trying to open a jQuery UI Dialog from my ASP.NET c# Code Behind. I have created the code below, but I can't get it to work, and am unsure how to debug the problem. How can I resolve this issue? My JavaScript: <script> $(function () { $("#dialog_info").dialog("destroy"); $("#dialog_info").dialog({ autoOpen: false, modal: true, buttons: { Ok: function () { $(this).dialog("close"); } } }); }); function show() { $("#dialog_info").dialog("open"); return false; } </script> My HTML: <body> <form id="form1" runat="server"> <div> <div id="dialog_info" title="information"> <asp:Literal ID=

Trigger event on dialog box open

无人久伴 提交于 2019-12-04 08:56:39
问题 My dialog box is defined under the div #dialogbox When the dialog box opens i want to trigger an event such that it alerts open. The code im using is: $("#dialogbox").dialog({open: function(){ alert("OPEN"); } }); But this doesnt seem to trigger when dialog box is opened Please help 回答1: You can use this : $( ".selector" ).dialog({ open: function( event, ui ) {} }); or the event listener .on $( ".selector" ).on( "dialogopen", function( event, ui ) {} ); More information in this page : http:/

How to popup a dialog in another frame using jquery-ui

北城以北 提交于 2019-12-04 04:23:40
问题 I'm creating a small web page using jquery-ui-1.8 which is having a frameset and three frames. <frameset id="mainFrame"cols="25%,*,25%"> <frame id="f1" src="test.php"></frame> <frame id="f2" src="test2.php"/> <frame /> </frameset> Then I have added a button to test.php file which is loaded at the first frame (f1) and a div to test2.php which is loaded at the second frame. <div id="testdiv"> this is test 2</div> Then I need to pop up a jquery dialog from "testdiv" on the second frame (f2) when

How to find out if jquery dialog was closed on escape and execute some code

旧巷老猫 提交于 2019-12-04 03:44:31
问题 I have a jquery dialog and I need to execute some_code() when I press Esc, or click the cancel button. With the cancel button its easy adding a function to the cancel button. $( '#mydialog' ).dialog({ closeOnEscape: true, close: function( event, ui ) { //some_code(); $(this ).dialog( 'destroy' ) }, buttons: { "OK" : function() { $( this ).dialog( "close" ); }, "Cancel" : function() { some_code(); $( this ).dialog( "close" ); } } }); But how can I execute some_code() after pressing ESC? This

Particular case: Programmed Query string using form inside dialog

淺唱寂寞╮ 提交于 2019-12-04 03:25:40
问题 I include a snippet of my project. When I run this code clicking add on the window's dialog, and inside the submit, Firebug responds with an error. I would like to know why this does not alert ("Se funziona questo mi hai aiutato"); http://api.jquery.com/submit/ There is a example at the end of the site and it works fine on my pc. Now I public my code or exercise where I use the form inside the window's dialog(Jquery). I want programmed and I have the solution but the script inside the

In IE8, jquery-ui's dialog set the height of its contents to zero. How can I fix this?

此生再无相见时 提交于 2019-12-04 03:02:41
I am using jquery UI's dialog widget to render a modal dialog in my web application. I do this by passing the ID of the desired DOM element into the following function: var setupDialog = function (eltId) { $("#" + eltId).dialog({ autoOpen: false, width: 610, minWidth: 610, height: 450, minHeight: 200, modal: true, resizable: false, draggable: false, }); }; Everything works just fine in Firefox, Safari, and Chrome. However, in IE 8 when the dialog is opened only the div.ui-dialog-titlebar is visible -- the div.ui-dialog-contents are not. The problem seems to be that while in the modern browsers

Position jquery UI dialog

≡放荡痞女 提交于 2019-12-04 02:27:30
How can I position the jquery UI dialog SPECIFICALLY, so that it goes to a position not defined by center, top, etc. Thanks, I have tried to be as specific as posible. Guillaume Cisco Using the position option : http://jqueryui.com/position/ Specifies where the dialog should be displayed. Possible values: 1) a single string representing position within viewport: 'center', 'left', 'right', 'top', 'bottom'. 2) an array containing an x,y coordinate pair in pixel offset from left, top corner of viewport (e.g. [350,100]) 3) an array containing x,y position string values (e.g. ['right','top'] for

Return value of jquery UI dialog Box

微笑、不失礼 提交于 2019-12-03 16:33:58
You may find solution over this in many posts( Post 1 , Post2 ), but their solution not working for me. Here is the normal jquery dialog box written by me. $("#dialog").dialog({ autoOpen:false, buttons:{ "ok":function(){ $(this).dialog("close"); return true; }, "cancel":function(){ $(this).dialog("close"); return false; } } }); I will open the dialogbox with code: var returnVal=$("#dialog").dialog("open"); I need to return false ,if user clicks 'cancel' and return true if user clicks 'ok'. var returnVal=$("#dialog").dialog("open"); I NEED returnVal to return boolean value(true/false), but it

How do I reload the page after an AJAX call is done with a dialog?

眉间皱痕 提交于 2019-12-03 15:40:24
so I have a dialog UI with a form once a user click on a link it opens. Once they click "Add button" it create a AJAX call that submits the data into the database. What I need to add is reload() function to refresh the page. How can I add the reload function? I have tried to add windows.localtion.reload(); you can see it my code. That line does not work for some reason //Update contact dialog box $( "#contact-edit" ).dialog({ resizable: false, width: 500, modal: true, autoOpen: false, buttons: { "Update Info": function(e) { var formData = $('#edit-form').serialize(); //submit record $.ajax({