I am rendering the user profile edit form ($form_id = 'user_profile_form'
) on a custom tpl.php
page. All the custom fields are user-defined under configuration > Account Settings > Manage Fields
:
Following is the code:
<?php $form = drupal_get_form('user_profile_form');?> <div class="some_class"> <?php print(drupal_render($form['field_2'])); ?> <?php print(drupal_render($form['field_3'])); ?> <?php print(drupal_render($form['field_4'])); ?> <?php print(drupal_render($form['actions'])); ?> </div>
All the fields are being rendered well. Even the submit and cancel buttons under the actions
field are rendered BUT they are not working. Nothing happens when I click on them.
Please point out any error.
UPDATE:
I should point out that I don’t want all the form elements to be rendered, which is why I am trying to render the elements separately.