ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Custom Fields in Registration

October 02, 2012 9:10am

Subscribe [1]
  • #1 / Oct 02, 2012 9:10am

    I have been looking for a simple solution to submit custom member fields as part of the registration form.  I am using a social media login tool and if they have not have an account, I would like to send them to the registration form with any profile information I receive pre-populated. 

    I have looked up previous posts for similar cases and have tried using name=“first_name” AND name=“m_field_id_1”.  Obviously no luck so far.

    Thanks for any help!

     

  • #2 / Oct 03, 2012 4:08pm

    Dan Decker

    7338 posts

    Hi jayatpeoplewhothink,

    The registration form can be onerous. There is a Wiki article for building a custom registration form. But you may have more luck with an add-on like FreeMember.

    Can you show me some of the template code you’ve tried so far?

    Cheers,

  • #3 / Oct 03, 2012 5:13pm

    Thanks for the response.  I am trying to avoid adding a new plugin, as we have already mixed and matched so many plugins that it becoming quite cumbersome.  Also, the registration form is live and working, but we are looking to add this update that will place information it pulls from facebook and automatically fill in custom member fields.

    Currently we have a stand alone registration form (all the irrelevant html replaced with //. . .) :

    <?
    $this->EE =& get_instance();
    $action_id = $this->EE->functions->fetch_action_id('Member', 'register_member');
    ?> 
    <form id="register_member_form" method="post" action="http://ourSite.com"> 
    <div class='hiddenFields'>
            <input type="hidden" name="XID" value={XID_HASH} /> 
            <input type="hidden" name="ACT" value="<?php echo $action_id; ?>" />
            <input type="hidden" name="RET" value="http://ourSite.com/" /> 
            <input type="hidden" name="FROM" value="" /> 
            <input type="hidden" name="site_id" value="1" /> 
        </div> <!-- closes out hiddenFields -->
    //. . . 
    <input type="text" name="email" value="<?=$email?>" maxlength="72" class="input" /></td>
    //. . . 
    <input type="text" name="email_confirm" value="<?=$email?>" maxlength="72" class="input"  /></td>
    //. . . 
    <input type="text" name="screen_name" value="<?=$screenName?>" maxlength="50" class="input"  /></td>
    //. . . 
    <input type="password" name="password" value="" maxlength="40" class="input"  />
    //. . . 
    <input type="password" name="password_confirm" value="" maxlength="40" class="input"  />
    //. . . 
    <input type="hidden" name="url" value="" maxlength="150" class="input" />
    //. . . 
    <input type="hidden" name="m_field_id_45" value="<?=$uid?>" />
    <input type="hidden" name="m_field_id_46" value='<?=$uidArray?>' />
    <input type="hidden" name="m_field_id_1" value="<?=$first_name?>" />
    <input type="hidden" name="m_field_id_2" value="<?=$last_name?>" />
    //. . . 
    {captcha}
    <input type="text" name="captcha" value="" size="20" maxlength="20" />
    //. . . 
    <input type="submit" value="{lang:submit}" class="submit" />
    //. . . 
    </form>

    You can see the hidden fields near the bottom with the m_field_id_… They are the problem fields that do not save any data.

    The PHP variables are all holding the correct values, I can see them when I view source with firebug. I’m just not sure what EE doesn’t like.

  • #4 / Oct 04, 2012 1:00pm

    Is this even possible through expression engine, or would I HAVE to get a plugin?

  • #5 / Oct 04, 2012 3:02pm

    Dan Decker

    7338 posts

    jayatpeoplewhothink,

    You don’t have to get an add-on, it just makes this a bit easier.

    What are you seeing for {XID_HASH} and $action_id ?

    What stage is your PHP parsing set to for this template?

    Cheers,

  • #6 / Oct 04, 2012 3:56pm

    XID= ‘819e16e849ae65443fe299133886e48bfa721d6e’

    ACT = ‘13’

    The PHP is set to parse on Output.

    Thanks!

  • #7 / Oct 05, 2012 3:44pm

    Dan Decker

    7338 posts

    Try setting the field name to the short name in the Control Panel.

    <input type="hidden" name="test-field" value="<?=$uid?>" />

    Let me know your results!

    Cheers,

  • #8 / Oct 05, 2012 3:51pm

    Figured it out… You HAVE to go to each member field you want to fill and set “Is field visible in registration page?” to yes before it will allow it to save to the database.

    Thanks anyway for the help.

  • #9 / Oct 08, 2012 12:43pm

    Shane Eckert

    7174 posts

    Hey there jayatpeoplewhothink,,

    Glad you got this resolved! Nice work.

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases