0

How do I get the list of fields present in a certain form, I know the form id, I just need the names of the fields present in that form ?

1 Answer 1

1

go to your template "template.php for example" or your module, and use

hook_form_alter(&$form, &$form_state, $form_id){ var_dump($form);exit(); }

and you will get very detailed look at your form

2
  • That would also give me other things like actions, submit etc. But I just need the field names.
    – user2948
    Commented Mar 12, 2012 at 15:05
  • try dumping the other variables "form_state" and "form_id" usually they have them.
    – saadlulu
    Commented Mar 12, 2012 at 21:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.