Tell us what you are trying to do?
I created a custom field of type "URL" with the expectation that the field would validate entries as being a valid URL of the format "enlace oculto" or "enlace oculto". Unfortunately, it appears that no validation is actually done to field entries and anything can be entered. Values with "enlace oculto" or "enlace oculto" are treated as external links (as expected) while plaintext entries are treated as subdirectories of the current form URL (unexpected).
Is there any documentation that you are following?
None that I can easily find...
What is the link to your site? enlace oculto
Is there any way to include a custom field validation to solve this issue?
Can you please share problem URL where you added your form and admin access details and also that what URLs you want to validate with what field.
Please share admin access details and frontend user access details (if required).
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
You can validate URL field value using following:
=> enlace oculto
If you can share more details what fields you want to validate with that form and what form of input should be given is valid and not valid I would be happy to share you the solution.
My expectation was that a custom field of type "URL" would, by default, validate that any field entry was in fact a valid URL. Apparently, that is not the case and any string entered into the field is allowed.
As you found, I have multiple custom fields of the type "URL". One is a generic URL field which I merely need to validate that the entry is a "fully qualified domain name" (e.g., enlace oculto or enlace oculto). Other fields are specific to social media platforms and should validate as necessary for the associated platform (e.g., for Facebook the field entry should be enlace oculto).
This does not happen on my site. Any string of text can be input in a "URL" type field. When a "URL" type field is displayed on the front-end, the field entry is either treated as a subdirectory of the current domain (e.g., field contains "random" which is then displayed as a link to enlace oculto) or as an external link if http:// or https:// are included (e.g., field contains "enlace oculto" which is then displayed as a link to enlace oculto).
Not sure what is different about how this is implemented on my site, but it certainly does not work as you describe above...
As shared you have custom validation required so you will have to use the Toolset Form validation hook: cred_form_validate
I'm not sure why URL validation is not available with your URL custom field on custom field group edit page. When I try to add a new URL custom field or even with existing I can see there is a URL validation available. Please check the following screenshot:
-enlace oculto
If you see your URL custom field I'm not sure why URL validation is not available. Rather then digging too deep in that I suggest you should use the form validation hook "cred_form_validate" and add your required validation.
It isn't clear from the documentation you linked how to use cred_form_validate for URL validation. Is there a more detailed explanation of how this is used with Toolset forms?
FYI, this was a clean/new install of Toolset so there may be something broken with the current Toolset install that is causing the URL validation option to not appear when creating/editing a form.
It isn't clear from the documentation you linked how to use cred_form_validate for URL validation. Is there a more detailed explanation of how this is used with Toolset forms?
==>
We do not have any other resource but if you want I can help with that but for that you will have to share all information about what fields you want to validate and what validations you want to apply.
FYI, this was a clean/new install of Toolset so there may be something broken with the current Toolset install that is causing the URL validation option to not appear when creating/editing a form.
==>
I'm not sure as with the sandbox site I shared with you there is a URL validation available on custom field group page and the same is not available on your install. Maybe you can try to reinstall the Toolset plugins and check if that helps or try another server.