This code should the document form with a set name, and then go
through each item in the form.  oForm is found, and oForm.length has
the correct length.  The items in the form, oForm[j] are undefined
however.

(Come from here http://userscripts.org/scripts/show/70459)

// plug in saved values;
    for (var i=0;i<5;i++) {
        oForm = document.forms.namedItem('FBAA-Form'+i);
        for (var j=0; j<oForm.length; j++) {
            oItem = oForm[j]
            if (oItem != undefined) {

                if (oItem.type == 'checkbox') {
                    oItem.checked   = aParams[oItem.name.split('-')
[2]];
                } else {
                    oItem.value     = aParams[oItem.name.split('-')
[2]];
                }
            } else {
                if (oItem.type == 'checkbox')
                    oItem.checked   = false
                else
                    oItem.value     = 0;
            }
        }
     }

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" 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/greasemonkey-users?hl=en.

Reply via email to