Issue 422: send ajax form, doesn't work success ajax option..
Status:  Fixed
Owner: ----
Closed:  Feb 2010
Reported by costi...@gmail.com, Jan 25, 2010
What steps will reproduce the problem?
After i submit a form with ajax in a nyromodal lightbox, the nyromodal script does not execute the success ajax option... The 
script insert in a correctly mode the data in a db, but when the php script finish execution, appear the error

What is the expected output? What do you see instead?
The output is: The requested content cannot be loaded. Please try again later. Close

I notice that if i insert complete ajax option, it works good, but i need success and errror ajax function..

What version of the product are you using? On what operating system?
1.5.5 nyromodal

Please provide any additional information below.

This is my script:

$('#registerSubmit').click(function(e)
    {
        // evitiamo che il form sia inviato prima che i controlli siano ok
        e.preventDefault();

        if($('#nickname').isValid() && $('#inputPassword').isValid() && $('#inputConfirmPassword').isValid() && 
$('#inputEmail').isValid() && $('#inputConfirmEmail').isValid() && $('#contratto').isValid())
        {
            $.nyroModalManual(
            {
                ajax:
                {
                    type: "POST",
                    url: "libs/newAccount.php",
                    //dataType: "html",
                    data: 
'username='+$('#nickname').val()+'&password='+$('#inputPassword').val()+'&repassword='+$('#inputConfirmPassword').val()+'&email=
'+$('#inputEmail').val()+'&reemail='+$('#inputConfirmEmail').val(),
                    //cache: false,
                    success: function()
                    {
                        $.nyroModalManual(
                        {
                            bgColor: '#3333cc',
                            content: 'Registrazione avvenuta con successo..'
                        });
                        alert("Bello..");                        
		    },
                     error: function()
                     {
		        alert("Errore nell'invio del form, riprova o contatta un Amministratore...");
	             },
                     complete: function()
                     {
                        alert("complete...");
                                             
                     }
                }
            });
        }
                    
        return false;
    });
Jan 26, 2010
#1 costi...@gmail.com
works perfecty.. i solved it.. close issue..

for other, this is the solution:

$.ajax(
            {
                type: "POST",
                url: "libs/newAccount.php",
                dataType: "html",
                data: 
'username='+$('#nickname').val()+'&password='+$('#inputPassword').val()+'&repassword=
'+$('#inputConfirmPassword').val()+'&email='+$('#inputEmail').val()+'&reemail='+$('#i
nputConfirmEmail').val(),
                cache: false,
                success: function(html)
                {
                    $.nyroModalManual(
                    {
                        minHeight: 5,
                        content: 'Registrazione avvenuta con successo.<br /><a 
href="index.php" class="nyroModalClose">Prosegui..</a>'
                    });
                },
                error: function()
                {
                    alert("Errore nell'invio del form, riprova o contatta un 
Amministratore...");
                }
            });
Feb 1, 2010
Project Member #2 nyro...@gmail.com
Sorry for the delay. The solution you finally found is the one.
Make a normal ajax call and doing what you need depending on the result.

Note that nyroModal overwritte the success callback (documented as a comment in the
settings section)
Status: Fixed