Hi

I have a rather large complicated form that changes considerably based
on database content and user interaction - therefore, I said to
myself, I need to serialize ??

The whole is I wish to serialize form elements, pass them to php
(Admin/editmylinks2.php)  - which would update database (working) and
then write the word 'good' back to page which would be processed by
(reportresult) and then the loadmenu function would bring content to
my div 'MiddleContent'.

My current problem is with the serialization process - I am getting
'form formlinks has no properties' error in FireFox errorconsole.  But
I also want to ask about my technique in general - the serialize form
followed by AjaxRequest followed by loadmenu function which calls
Ajax.Updater...

<form method="post" id="formlinks" name="formlinks" action="Admin/
editmylinks2.php" onsubmit="validatethis();">

validatethis = function()  // this function arrives through AJAX with
the form, that seems OK; other functions (loadmenu, reportresult,
loadingScreen) arrive with original page
{
        // bunch of error checking here which if there are errors makes
submitOK = false
        if (submitOK == "false"){
                return false;
        } else {
                loadingScreen('MiddleContent','Loading...');
                var parms = $('formlinks').serialize(true);
                new Ajax.Request('Admin/editmylinks2.php', {asynchronous:true,
postBody:parms, onSuccess:reportresult});
                loadmenu();
        }
}

function reportresult(transport) {
        var response = transport.responseText;
        if (response == 'good')
                document.getElementById("mlprerresult").innerHTML = 'Your 
request
completed successfully';
        else
                document.getElementById("mlprerresult").innerHTML = 'Your 
request
failed!!!';
}

function loadMenu() {
        var trader = $F('mlptrader');
        var department = $F('mlpdepartment');
        var region = $F('mlpregion');
        var office = $F('mlpoffice');
        var user = $F('mlpuser');
        var jack = 'Y';
        loadingScreen('MiddleContent','Loading Navigation');
        if (trader) {
                new Ajax.Updater('MiddleContent', 'site/traderhomecenter.php',
{asynchronous:true, postBody:'dept='+department+'&reg='+region
+'&off='+office+'&user='+user+'&jack='+jack, onlyLatestOfClass:
'Ajax.Updater'});
        } else {
                new Ajax.Updater('MiddleContent', 'site/adminhomecenter.php',
{asynchronous:true, postBody:'dept='+department+'&reg='+region
+'&off='+office+'&user='+user+'&jack='+jack, onlyLatestOfClass:
'Ajax.Updater'});
        }
}

All help greatly appreciated
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to