Use e-mail as username
Posted: 10 September 2008 10:21 AM   [ Ignore ]
Newbie
Rank
Total Posts:  11
Joined  2008-09-10

Hi there,
I am using the User module with option ‘use e-mail as username’ turned on.

Now, I would like to simply the registration page:

<form id='register_member_form' method="post" action="http://www.psaholland.org/index.php"  >

<
div class='hiddenFields'>
<
input type="hidden" name="XID" value="{XID_HASH}" />
<
input type="hidden" name="ACT" value="7" />
<
input type="hidden" name="RET" value="http://www.psaholland.org" />
<
input type="hidden" name="FROM" value="" />
<
input type="hidden" name="site_id" value="1" />
</
div>

   <
fieldset id="registerform">
  <
div><label for="e-mail">E-Mail (wordt in principe niet getoond in het sprekersprofiel):</label><br>
  <
input type="text" name="email" value="" maxlength="100" class="text" />
  <
input type="hidden" name="username" value="" maxlength="100" class="text" /></div>

  <
div><label for="password">Password:</label><br>
  <
input type="password" name="password" value="" maxlength="32" class="input" size="25" /></div>

  <
div><label for="passwordrepeat">Password:</label><br>
  <
input type="password" name="password_confirm" value="" maxlength="32" class="input" size="25"</div>

The thing is, that I would actually like to copy the e-mail field into the username field. This because username and e-mail are mandatory, but the same and I would like to ask the user just once.

What would be the solution for this one?

Erwin

Profile
 
 
Posted: 11 September 2008 06:52 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Erwin,

The correct way to do this is omitting the Email field, and using the “username” field as the Email field. smile

Change this:

<input type="text" name="email" value="" maxlength="100" class="text" />
<
input type="hidden" name="username" value="" maxlength="100" class="text" />

To this:

<input type="text" name="username" value="" maxlength="100" class="text" />

 Signature 
Profile
 
 
Posted: 11 September 2008 07:10 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  11
Joined  2008-09-10

ok, thanks!

Profile
 
 
Posted: 15 September 2008 11:37 AM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  11
Joined  2008-09-10

That seemed very simple, but now I’tried it, and this is the error message a user sees:

You must submit an email address

Any suggestion?

Profile
 
 
Posted: 15 September 2008 11:44 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Try adding this parameter smile

username_override="yes"

 Signature 
Profile
 
 
Posted: 15 September 2008 02:19 PM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  11
Joined  2008-09-10

Yup. Did that:

<form id=’register_member_form’ method="post" action="http://www.psaholland.org/index.php" username_override="yes" >

But that looks very strange.

It feels as if I’m missing a statement somewhere…

Erwin

Profile
 
 
Posted: 15 September 2008 02:21 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Are you actually hardcoding the Source code?

<form id=’register_member_form’ method="post" action="http://www.psaholland.org/index.php" username_override="yes" >

 Signature 
Profile
 
 
Posted: 15 September 2008 02:28 PM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  11
Joined  2008-09-10

I’m not exactly sure what you mean but I just cut-and pasted the code above in this posting…

Profile
 
 
Posted: 16 September 2008 03:48 AM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  11
Joined  2008-09-10

I used {exp;user:register} and the problem was solved. The thing was that I just copied and paste the statements from another site that didn’t make use of this e-mail as username feature

Thankss

Profile
 
 
Posted: 16 September 2008 08:17 AM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18
Erwin van Lun - 15 September 2008 02:28 PM

I’m not exactly sure what you mean but I just cut-and pasted the code above in this posting…

Well, if your code was literally:

<form id='register_member_form' method="post" action="http://www.psaholland.org/index.php" username_override="yes" >

And NOT:

{exp:user:register form_id="register_member_form"  return="template_group/template" username_override="yes"}

Then that would definately be an issue.

 Signature 
Profile
 
 
Posted: 16 September 2008 08:22 AM   [ Ignore ]   [ # 10 ]
Newbie
Rank
Total Posts:  11
Joined  2008-09-10

yup confused

Profile