User:Forgot Username
- Home
- Documentation
- Modules
- User
- Tags
- Forgot Username
The User:Forgot_Username function allows your users to retrieve their forgotten username to your site by entering in their email address on file.
{exp:user:forgot_username} content {/exp:user:forgot_username}
Parameters
The following parameters are available for use:
error_page=
error_page="user/error_template"
The 'error_page' parameter allows you to bypass the EE message template for displaying errors, and instead show your own regular template with the error messages. Error template must follow guidelines of User Error Page.
form:attribute=
form:class="your_class"
The 'form:attribute' parameter allows you to control any form attribute for the form in your template. Simply replace 'attribute' with an attribute name such as 'id', 'name', 'class', etc, and specify a value for that attribute. You can specify this parameter multiple times to control as many attributes as necessary. This would normally be done to control your form with Javascript or style it with CSS.
onsubmit=
onsubmit="some_javascript()"
The 'onsubmit' parameter allows you to execute Javascript functions at form submission.
return=
return="user/thank_you_template"
The 'return' parameter allows you to return the user to a specified template upon submittal of form.
Form Fields
The following form fields are available for use:
<input type="text" name="email" id="email" />
The 'email' field is the field in which the user would specify their email address to retrieve their username, and is a required field.
Examples
The following is a complete example of what a Forgot Username form might look like:
<h2>Forgot Username?</h2>
<p>If you've forgotten your username, just enter your email address you registered with and you will receive an email informing you of your username.</p>
{exp:user:forgot_username return="user/thank_you_template"}
<p><label for="email">Email Address <span class="required">*</span></label><input type="text" name="email" id="email" /></p>
<p><input type="submit" name="submit" value="Submit" /></p>
{/exp:user:forgot_username}


