I have a form with a select box and a text input. When I select an
item in the select list the page make an ajax call request to a php
script that returns rows from mysql.

I am able to add items to the db by entering a value in the text input
and hitting submit.
The problem is I want the list(previously pulled from db with ajax
call) to be refreshed, so inside my oncomplete
I use the following:

function addNewType(name,tableName){
        var aj = new Ajax.Request(
                        '../functions/adminFunctions.php',{
                                method:'post',
                                parameters:{tableName: tableName, newType: 
name},
                                onComplete: function(){
                                        showTypes(tableName);
                                }

}
                        );



}


But the showTypes does not seem to be getting called at this point.
I can put an alert in and that will work, but calling my showTypes
function again does not get
the list again.


function showTypes(tableName){
        var aj = new Ajax.Updater('types',
                        '../functions/adminFunctions.php',{
                                method:'post',
                                parameters:'tableName='+tableName,
                                onComplete: showResponse

}
                        );
}


function showResponse(req){

        $('types').update(req.responseText);
}


Is there any way to get my showTypes to run again after I add the new
value to the DB?

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to