New Account Validation

From TNG_Wiki
Jump to navigation Jump to 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 28 Jan 2023
Download link For
TNG 14.0
14.0.0.4f
For
TNG 13.0
v13.0.0.43e
Download stats
Author(s) Robin Richmond
Homepage New Account Validation (This page)
Mod Support My Mod Support form
Contact Developer My Mod Support form
Latest Mod 14.0.0.4f
Min TNG V 12.0
Max TNG V 14
Files modified
newacctform.php
admin_genconfig.php
admin_updateconfig.php
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, |}# Uses a mod option to let the site administrator determine whether the phone, city, state, and/or notes fields are required.

  1. Re-writes the form validation routine so that all form errors are shown in one message, instead of one-at-a-time, and that the missing required filed are highlighted in red.
  2. Adds optional notes to the top and/or bottom of the form. The note text can come from a mod option or from custom text strings.

Mod Options

These mod options are custom TNG settings, defined and edited in a Mod Settings Block in the form at Admin>>Setup>>General Settings, in a new subform named Mod Settings Blocks. The Mod Settings Blocks mod is a prerequisite for the installation of this mod.


  • Required fields - A set of checkboxes that allow most of the fields in the form to be marked as required.
  • A group of fields that determine how the configurable message for the top of the form will be defined. The primary selection here is between a radio button set with two choices:
    1. Use the text defined here in the mod options
      • A subordinate textarea field specifies the message text to be used no matter what language the end-user selects.
      • The mod defines default message text for two message. Right next to the textarea field, a small button labeled with 'D' (for Default) allow you to restore the default text.
    2. Use the language string $text['rrnav-toptext']
      • This language string can be defined for as many languages as the you want. If no string is defined for a given language (other than English-UTF8), the English string will be used. Thus if it is possible for a user on site to select a language for which you have not specified a string. and you want a message to be displayed, then define $text['rrnav-toptext'] in English. And if English-UTF8 is a site option (and, again, if you want a message to be displayed), you must define the English-UTF8 string.
      • Each language's text string must be defined (like other site-specific language strings) in the language's cust_text.php file. In most case, the strings should be defined at the bottom of the cust_text.php file.
  • An identical group of fields that determine how the configurable message for the bottom of the form will be defined. The text string associated with the second radio button is $text['rrnav-bottomtext'].

Compatibility With Other Mods

  • v13.0.0.4e of this mod is compatible with Password Generator
  • This mod is not compatible with New Account Form Mod, which serves the same general purpose, but which is not as flexible as this mod. This mod also distinctly improves the way that users are informed when required fields have no value.

Related Mods

  1. New Account Warning is related in that it also affects the New Account Registration form. If the page uses http rather than https, it adds a comment to the password field noting that the form isn't encrypted and that the user should not use a password that is used anywhere else.
  2. The Mod Settings Blocks mod packages this mod's options into what I call a "Mod Settings Block", which is a set of form fields that formatted and labeled so that it stands out among other options in an Admin>>Setting form. Mod Settings Blocks is a prerequisite for this mod; it must be installed before this mod can be installed.

Installation

{{{language}}}


[Show Standard Installation Process]

Requirements

  • A working TNG installation.
  • An installed current version of the Mod Manager.
  • You should backup files listed in the panel on the right.

Procedure

  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.

Problems?

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


Visualizations

BEFORE
The fields required by the native program are marked with an asterisk.
New account warning-before.jpg
AFTER:
  1. The custom message at the top of the form is highlighted
  2. The required fields that have been selected in the mod options are marked with an asterisk and with the placeholder 'Required'
  3. The custom message at the bottom of the form is highlighted.
New account validation-after.jpg
Form field error messages

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. This mod rewrites the form validation function so that it tells you how many required fields are missing and defines a red border around each missing field.
New account validation-errors.jpg

The Mod Settings Blocks

msbviz1


msbgenconfig


New account warning-msb.jpg

Revision History

Mod Version TNG Version Date Note
14.0.0.4f 14 28 Jan 2023 No functional changes. Upgraded to TNGv14
13.0.0.4e 13.* 03 Jan 2022 Established compatibility with Password Generator
13.0.0.4d 13.* 21 Dec 2020
  • Eliminated a "headers already sent" PHP error that shows up only very rarely.
  • Better slash-quoting of the message text in the mod options.
13.0.0.4c 13.* 29 Sep 2020
12.0.0.2c 12.* 05 Nov 2018 v2a was not compatible with TNGv12.0.2; I'm not actually sure what was wrong with v2b; there may simply have been problem with the uploaded file.
9.2.2.2p 9-11.1.2 01 Oct 2018 No functional changes; changed the cust_text.php search string so that this version of the mod is compatible with TNGv9.2.2. through TNGv11.1.2.
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 TNG site to the table below:

URL User Note Mod-Version TNG-Version User-language
Robin's Roots Robin Richmond Mod developer 14.0.0.4f 14 EN
Baker Family History Jon Baker Public site 9.2.2.2* 11.1.2 EN
Hooley Family Links Rick Hooley Public/Private See Here See Here EN
The Cole / Tanner Family Tree David Cole Public/Private see here see here EN,DE,FR,ES,NL
Bastiaanssen Genealogy Jan Bastiaanssen Public / Private 14.0.0.4f
TNG 14.0.5
EN,NL,ES
Your Roots are Showing Harold Craswell Public/Private See Here See Here EN
Van Peer Project Drew McClenaghan Private 14.0.0.4f 14.0 EN
Solem Genealogy Jan-Thore Solem Private 14.0.0.4f 14.0.5 EN,NO
R G Strong Family Genealogy Russell Strong /Public/Private 14.0.0.4f 14.0.2 EN,FR,DE,NL