By xDudditzx on
I have been setting up several categories of profile fields for users
and would like to validate some of the fields input.
For instance, for a YouTube url, I want to validate that it is, in fact YouTube and not SpamTube.
Is there any way to achieve regex validation of profile fields?
Anyone know the hook, ( profile_validate_profile ) ?
Of course, this would have to hook the profile form and the registration form.
( _user_register ) ?
Thanks
Comments
Found any solution yet?
Found any solution yet?
A custom module approach
I did find a module approach to validation which I found here:
http://thedrupalblog.com/adding-validation-user-edit-form-ensure-usernam...
If you wanted to also validate on registration, you would alter the conditional like so:
if ($form_id == 'user_register' || $form_id == 'user_profile_form') {
I did not need email validation but rather a string length check so my validation looked similar to this:
Still hope to find a better way aside from using a custom module.
Think the following is what you are looking for
http://drupal.org/node/17540
Thank you. I have no clue
Thank you.
I have no clue what I was working on at that time, but I thank you anyway for the help.