Custom Register Form

Permalink
Hi,

I'm trying to implement a custom register form with additional fields such as full name, which will be set to the user's attribute. Currently i'm using this code:
<div>
   <?php echo $form->label('full_name', t('Full Name') )?><br/>
   <?php echo $form->text('full_name')?>
   </div>
<input type="hidden" name="akID[<?php echo UserAttributeKey::getByHandle('full_name')->getAttributeKeyID(); ?>][value]" value='<?php echo $_POST['full_name']; ?>'/>


However, this code only works if I make a mistake first i.e. if I enter in correct passwords and then the user attributes will be set after register.


How can I amend this so that they are added all the time?

Regards,

Dan