Grabbing the field names for a form

Grabbing the field names for a form

Hi,

I want to grab all the field names for a particular form 

                fieldslist = getFieldNames();    // would be from the form itself  in the onSuccess action

But what if I'm working in a function.

Thank you

Guy