These functions work just fine in Firefox for Win or Mac, however,  
they don't work at all in IE or Safari.  Using Safari's debugger, I'm  
told there is a Syntax error on line 22 [ var updateDB = function 
(class,divid,tn,fn,identifier,value) ], but I just don't see it.   
Each of these functions is being called from an onclick event except  
showAllOutput(), which is called from the body's onload event.  I've  
also tried declaring these functions in the normal "function showForm  
()" way with no difference in results.  Am I missing something here?


var showForm = function(fn,identifier)
{
                var output = $('output'+fn+identifier).hide();
                var input = $('input'+fn+identifier).show();
                var waiting = $('waiting'+fn+identifier).hide();
}

var showOutput = function(fn,identifier)
{
                var output = $('output'+fn+identifier).show();
                var input = $('input'+fn+identifier).hide();
                var waiting = $('waiting'+fn+identifier).hide();
}

var showWaiting = function(fn,identifier)
{
                var output = $('output'+fn+identifier).hide();
                var input = $('input'+fn+identifier).hide();
                var waiting = $('waiting'+fn+identifier).show();
}

var updateDB = function(class,divid,tn,fn,identifier,value)
{
                var url = 'update.php';
                var params = 'class='+class+'&divid='+divid+'&tn='+tn+'&fn='+fn 
+'&id='+identifier+'&value='+value;
                                
                new Ajax.Request(url, {
                  method: 'post',
                  parameters: params,
                  onCreate: function() {
                          var div = $('input'+divid);
                          showWaiting(fn,identifier);
                        },
                  onSuccess: function(transport) {
                        alert(transport.responseText);
                        showOutput(fn,identifier);
                  }
                });
}

var showAllOutput = function()
{
        var inputArray = document.getElementsByClassName('input');
        var outputArray = document.getElementsByClassName('output');
        var waitingArray = document.getElementsByClassName('waiting');
        
        for(i=0;i<inputArray.length;i++)
        {
                $(inputArray[i]).hide();
        }
        for(i=0;i<waitingArray.length;i++)
        {
                $(waitingArray[i]).hide();
        }
        for(i=0;i<outputArray.length;i++)
        {
                $(outputArray[i]).show();
        }
}

--Josh

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to