Make telephone and other fields required at registration

From OSClass

We thought that the less data we required at registration process, the easier for the user and the more probable they will complete the process. But sometimes you need to ask for some useful information at that stage. For that reason we've created a plugin which main goal is to be used as a base or example for more complex registration process. The plugin will make you able to make any field required.


How does it works?

The plugin will include the plugin's file form.php in the middle of the current form. form.php has the new fields and rules, some of them are commented (disabled) as an example. Feel free to modify the file form.php to suit your needs.


Download

Download the plugin from Osclass' sourceforge page


Notes

  • Validation is driven by Jquery Validation plugin, so more complex validation could be used
  • You could make any field optional if you enable it at the form, but the validation remains disabled
  • You can not validate a field that does not exists (common sense)
  • Minimum HTML/JS knowledge is required
  • index.php should NOT be modified, fields and rules are located in form.php and there's no need to modify index.php (unless you want to add your own extra fields, but that's more complicated since you need to create new tables and methods)
  • Some modifications should be done to user-register.php file in your theme in order to display everything correctly <?php osc_run_hook('user_register_form') ; ?> should be placed before the recaptcha line and <?php UserForm::js_validation() ; ?> should be placed anywhere before the hook.