This project is not covered by Drupal’s security advisory policy.
UV provides a structured way to add AJAX validation to forms on per field basis. It is directed to developers. Writing a custom module is required.
Beta testers wanted!!! If you get the module working for you, I would appreciate if you would create an issue for me to publish an official release.
UV validates the field real-time while the user is typing something in the field. Errors are displayed inline.
There are many modules that offer similar kind of functionality like Clientside Validation and all the related modules. UV is different as it allows making server dependent validations. It is necessary when you need to compare the value to a database or some other data source which you cannot send to the browser as a whole.
Usage example
UV uses CTools plugins for adding validation to fields. Here's a simple example to get you started.
- Install the module as usual.
- Rename the folder /sites/all/modules/uv/plugins/uv_example to /sites/all/modules/uv/plugins/uv.
- Clear the cache.
- Add a text field to some of your content types with machine name 'field_identity_number'.
- Edit the field settings.
- Under 'Size of textfield' you can find a checkbox ' Universal validation' > 'Enabled'. Check it.
- Add new content and try to enter values '1', '123', '124' and '007' to the field.
- You should see real-time validation messages as you type.
- Now go and study the files inside /sites/all/modules/uv/plugins/uv to understand what's happening.
Adding validation plugins to your own module
Add this to your .module file.
/**
* Implements hook_ctools_plugin_directory().
*/
function MYMODULE_ctools_plugin_directory($module, $plugin) {
if ($module == 'uv') {
return 'plugins/'.$plugin;
}
}
After this add plugin files to plugins/uv inside your module folder. See the example above to understand how the plugins are structured.
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Module categories: Site Structure
- Created by jiv_e on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Bug fixes
Development version: 7.x-1.x-dev updated 25 Jun 2018 at 21:13 UTC