New Account Validation

From TNG_Wiki
Jump to: navigation, search
New Account Validation
Summary Adds optional required fields and "better" form validation (plus a couple of message) to the New Account Form
Validation
Mod Updated 15 May 2018
Download link
v12.0.0.2a
TNG 12.0
v9.2.2.2
TNG 9.0
TNG 10.0
Download stats
Author(s) Robin Richmond
Homepage Robin Richmond's Genealogy Database
Mod Support My Mod Support form or TNG Community Forums
Contact Developer My Mod Support form
Latest Mod v9.2.2.2 & v12.0.0.2a
Min TNG V 10.1
Max TNG V at least 12.0
Files modified
newacctform.php, English cust_text.php, genstyle.css
Related Mods
Notes


Purpose of the Mod

Adds optional required fields and "better" form validation (plus a couple of message) to the New Account Form. That is,

  1. Uses a mod parameter to let the site administrator determine whether the phone, city, state, and/or notes fields are required.
  2. Re-writes the form validation routine so that all form errors are shown in one message, instead of one-at-a-time.
  3. Adds a note to the top of the form,
  4. Adds a note next to the Notes field requesting that the user specify a relative already in the database.

These two notes can be suppressed or modified through mod options.

Mod Options

  1. A string of required field names. All of the original required fields are still required. This string just lets the installing administrator make the phone, city, state, and/or comments fields required.
  2. A parameter that lets the admin suppress or change the message that goes at the top of the form.
  3. A parameter that lets the admin suppress or change the message that goes next to the notes/comments field.

Compatibility With Other Mods

Not compatible with New Account Form Mod, but is very similar. This mod's messages are different, but they can be changed by mod options.

Related Mods

  • New Account Warning adds a comment to the password field noting that the form isn't encrypted, and the user should not use a password that is used anywhere else.
  • This mod saves information that can be used by Show Mod Names, but only if the optional Show Mod Names mod is installed.

Requirements

  • A working TNG installation.
  • An installed current version of the Mod Manager.
  • You should backup files listed in the panel on the right.
  • New Account Form Mod must not be installed.

Automated Installation

  1. Remove and delete previous version of this mod.
  2. Backup the files updated by this mod. They are listed in the panel at the upper right.
  3. Download the .zip file, Extract its .cfg file to the mods folder.
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files.

In the event of a problem

  1. Try using the Mod Manager Remove capability
  2. Contact me through My Mod Support form.

Visualization of this Mod

BEFORE As the form looks in TNG v9.2.2 through v11.1.1
New account warning-before1.png

Note also, that with the pristine code, the form validation routine displays only the first error it encounters. When the user corrects that error and resubmits, the form validation routine might then display a message about a different error.

AFTER:
New account validation-after.png
This mod rewrites the form validation function so that

a) Four additional fields can be required, and b) All errors are reported in one message New account validation-after-errors.png

Custom Text

The following strings are defined in the English and English-UTF8 versions of cust_test.php

# This text is placed at the top of the form.
$text['newacctintro1'] = 'An account serves only to allow you to see living people in your branch of my family tree.';
$text['newacctintro2'] = 'You must specify a relative - more recent than 1800 - to get an account.';
# This text is placed next to the notes field.
$text['acctcommentsmsg'] = 'Please include your relationship to me or to some member of my family. (Ideally, list the record ID of the person you are related to.)';
# These next 4 strings are error messages for missing required fields.
$text['enterphone'] = 'Please enter a telephone number';
$text['entercity'] = 'Please enter a city';
$text['enterstate'] = 'Please enter a state';
$text['enteremail'] = 'Please enter a valid e-mail address.';
$text['enteracctcomments'] = 'Please enter a comment with information about your relationship to me or to someone in my family';

You may modify first two message with mod options. You can modify the error messages by redefining them at the bottom of your language cust_text.php file

Revision History

      • The latest version of the mod is at the top of this table ***
Mod Version TNG Version Date Note
12.0.0.2a 12.0+ 15 May 2018 No functional changes; made compatible with TNGv12.
9.2.2.2 9+ 21 Feb 2016 Changes include:
  • Ken Roy fixed a bug for me. It wasn't turning off <strong> at one point.
  • The mod now puts the word "Required" as a placeholder in all required fields (not just the optional ones), and removes the old message saying '* Required field'
  • Moves the Notes/Comments message below the field when in mobile mode.
  • A new style rule (in genstyle.css):
    • Puts a mininum width on the first column of the form layout table to make sure that the form prompts column is not forced to be too narrow by the Notes/Comments message.
    • Right-justifies the form prompts
9.2.2.1 9.2.2 - 10.1.3 21 Feb 2016 New mod, with most of its functionality taken from New Account Warning v3.

Sites using this mod

If you download and install this mod, please add your site to the table below.

URL User Note Mod-Version TNG-Version User-language
Robin Richmond's Genealogy Database Robin Richmond Mod developer 9.2.2.2 11.11.1 English
MOTYER Family Genealogy John Mark Motyer Public site see here see here EN, DE, RU