Issue 328: Form Modal - Callback?
Status:  WontFix
Owner: ----
Closed:  Nov 2009
Reported by atour...@gmail.com, Sep 8, 2009
Is there a way assign a callback with returned data when the form has been 
submitted?

I'm used to jquery.form where I can provide a callback to the success of a 
form submission to then do other stuff with the returned data.


I spent hours last night trying to use only nyroModal's form submission.  

Using 
$.nyroModalManual({
  url: 'some ajax with form code'
});
The Ajax loaded the form
<form class="nyroModal"> 

nyroModal then makes this a form that Submits via AJAX (this is cool BTW) 
and shows the loading symbol on submission.

But afterwards, I had trouble returning data or calling script methods that 
were on the main page. (I'm not using iFrames).

Anyways, a callback would be nice. :)



Sep 9, 2009
Project Member #1 nyro...@gmail.com
instead of creating a new callback, you could simply add a callback to the complete
ajax event like that:
$.nyroModalSettings({
  ajax: {
    complete: function(XMLHttpRequest, textStatus) {
      // do your stuff here.
    }
  }
});

The ajax settings is used for basic ajax load and for form load.
Oct 13, 2009
Project Member #2 nyro...@gmail.com
Any news about this issue?
Nov 8, 2009
Project Member #3 nyro...@gmail.com
(No comment was entered for this change.)
Status: WontFix
Mar 1, 2010
#4 atour...@gmail.com
Wow, it's been a long time since I've looked at my code.

I guess the problem is hard to explain...
I have three scripts I want to show in the modal:
 - image_upload.php
 - image_upload_receive.php
 - image_crop.php

First, I open up with $.nyroModalManual the image_upload.php which contains 
<form class="nyroModal" action="image_upload_receive.php">
After the image is uploaded to image_upload_receive.php I just pass the name of the 
image.  I then want to run $.nyroModalManual again to the url image_crop.php?
image=image_name.

Am I totally over thinking this? Should this be in an iframe?

If I'm crazy, just let me know. :)
Mar 2, 2010
#5 atour...@gmail.com
Just an FYI: I'm over thinking it.   I'm going to make the image upload/crop into it's 
own pages. :)