hello
I am Create one website in that website More than One registration Form.
In that Form field are as follows .
field actual required actual
1. Name Only accept String It accept Number and String
2. Contact Number Only accept Number It accept Number and String
3. Resume Only accept word File Or PDF Format It accept all format( like video, Image)
How to validate this all fields??????
Link .
1. hidden link
2. hidden link
Please show attachment Screenshots to more information.
Thanks,
Dharanendra
In Toolset, when you create CRED user Forms, no Phone Number is added.
Hence, you use either a Custom User Field or took control over another (3rd Party) field with CRED.
To have a Field validated in the way you want, I suggest to head to Toolset > User Fields and add a Number Custom Field.
That will not allow any other characters but numbers.
Or, you can use an API hook of CRED to validate that Field:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
Name, Nickname, Username all accept by default strings and numbers, and that is just WordPress default behaviour, we cannot change that.
What you can do is use as well a CRED API validation that hooks your Custom Code validation to the form:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
Note that, CRED API is a set of hooks that allow you to hook your custom code to the form, at the right moment.
The API does not provide custom code solutions, this means, the validation itself must be coded by you, or another programmer, according PHP and WordPress coding standards.
The API just is a hook, that allows you to fire your own code at the right moment of form submit.
To validate a Upload (file) Field, you can use the exact same hook.
Please let me know if you have any other issue with CRED!