Topic: getFormValues support for ckeditor

I'm not sure if this the right forum for this post.
I needed getFormValues to support a form which contains ckeditor, my problem was that I use a server generated form so i don't now how many ckeditor elements are in the form and how they are called.
I use the feature to replace the textaerea element by class Attribute.
So I changed my getFormValue JS to recognize these elements by class now I only have to set the class Attribute of the textarea to "ckeditor", the ckeditor script replaces the textarea automaticly and my xajax script sends the data to the server, no need for special script for each editor.
Maybe there are better methods out there but this is a very easy one. I think this feature would be nice for xajax 0.6


xajax.tools._getFormValue = function(aFormValues, child, submitDisabledElements, prefix)
{
    if (!child.name)
        return;
        
    if ('PARAM' == child.tagName) return;
        
    if (child.disabled)
        if (true == child.disabled)
            if (false == submitDisabledElements)
                return;
                
    if (prefix != child.name.substring(0, prefix.length))
        return;
        
    if (child.type)
        if (child.type == 'radio' || child.type == 'checkbox')
            if (false == child.checked)
                return;

    var name = child.name;

    var values = [];

     if ('select-multiple' == child.type) {
         var jLen = child.length;
         for (var j = 0; j < jLen; ++j) {
             var option = child.options[j];
             if (true == option.selected)
                 values.push(option.value);
         }
     } else if(child.className =='ckeditor')
     {
         eval("values=CKEDITOR.instances."+child.name+".getData()");
     
     }else{
         values = child.value;
     }
     if(name.indexOf('_')>=0)
     {
              
      name=name.replace(/_(\w.+)_/,"[$1]_");    
     name=name.replace(/_(\w.+)/,"[$1]");
    
    }
    var keyBegin = name.indexOf('[');
    if (0 <= keyBegin) {
        var n = name;
        var k = n.substr(0, n.indexOf('['));
        var a = n.substr(n.indexOf('['));
        if (typeof aFormValues[k] == 'undefined')
            aFormValues[k] = [];
        var p = aFormValues; // pointer reset
        while (a.length != 0) {
            var sa = a.substr(0, a.indexOf(']')+1);
            
            var lk = k; //save last key
            var lp = p; //save last pointer
            
            a = a.substr(a.indexOf(']')+1);
            p = p[k];
            k = sa.substr(1, sa.length-2);
            if (k == '') {
                if ('select-multiple' == child.type) {
                    k = lk; //restore last key
                    p = lp;
                } else {
                    k = p.length;
                }
            }
            if (typeof p[k] == 'undefined')
                p[k] = []; 
        }
        p[k] = values;
    } else {
        aFormValues[name] = values;
    }
}