javascript - Get data from jquery dialog when close the dialog -


I try to get data from the jquery dialog box. I got it for the first time but the next time the data is the same, this is my code

  window. $ ('& Lt; div align = "center" style = "width: 100%; height: 100%;" & gt; iframe id = "ictdg" src = "item_new_cat.php? Itty =' + itty + '"Width =" 100% "height =" 100% "frameborder =" 0 "& gt; & lt; / iframe & gt; & lt; / div & gt; (): ({Modal: true, Width: 400, height: 250, title: 'New class registration', button: [{text: "Save and close", click: function () {var nwcg = $ ('(' # NTDG '). (). ('# Nwcc') .Wall (); Alert (NWCG); // This data is not refrain. $ (This) .DILOG ("closed")}}}]});  

Instead of putting functionality, click on an external function:

  button: [{text: "Save and close", click: function () {var nwcg = $ ('# ictdg Search ('# nwct'). Val (); Warning (nwcg); // This data is not refreshed. $ (This) .dialog ("off");}}  

Try:

  function getValue () {var nwcg = $ ('# ictdg'). Content (). ('# Nwct') Val () .; Warning (nwcg); // This data is not refreshed ??? $ (This) .dialog ("off"); }  

and

  button: [{text: "Save and close", click: getValue}]  

I think what happens when you start the dialog with the inline function, it runs once and always returns the same value.


Comments