Home arrow Our Main FAQ

Making the first name and last name fields mandatory Making the first name and last name fields mandatory

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

To make the first name and last name fields mandatory, follow these simple steps:

1. Open the file listmessenger.php in the public directory

2. Find the following line on line 97

// Error checking for e-mail address information.

3. Insert the following code BEFORE this line

// Error checking for missing first or last name
if((!$info["firstname"]) || (trim($info["firstname"]) == "")) {
$ERROR++;
$TITLE = $language_pack["error_default_title"];
$MESSAGE = $language_pack["error_subscribe_no_firstname"];
}
if((!$info["lastname"]) || (trim($info["lastname"]) == "")) {
$ERROR++;
$TITLE = $language_pack["error_default_title"];
$MESSAGE = $language_pack["error_subscribe_no_lastname"];
}

5. Save and close the file

6. Open the file english.lang.php in the public/languages directory

7. Find the following line:

$language_pack["error_subscribe_no_email"] = "Please enter an e-mail address that you would like subscribed to our mailing list.";

8. Insert the following code AFTER this line:

$language_pack["error_subscribe_no_firstname"] = "Please enter your first name to subscribe to our mailing list.";
$language_pack["error_subscribe_no_lastname"] = "Please enter your last name to subscribe to our mailing list.";

Make similar modifications to any alternative language files you may have.

9. Save and close the file

10. Upload the two files you just modified to the correct locations on your host.

Please make backups of any files before you make any changes, this is if anything should go wrong you can then restore the originals.
Article is in the following categories:
KB » mosListMessenger



Leave A Comment

or close

Email This Article

or close

Existing Comments

There are currently no comments.

myNotes My Notes

You currently have no notes on this article. You can leave your own note on this page, the note can only be seen by you (and our administrators) but not other users.

You need to login first

Related Articles

The following articles may be related to this one:

  • No related Items

Making the first name and last name fields mandatory Article Information

Hits:
1643
Created:
Friday, 26 January 2007
Author:
Joomla Components
Last Modified:
Friday, 26 January 2007
Access:
Public
Version:
2