Hi,
I want users to use an email adress at a specific domain for registration (in order to ensure, that the user works for a specific company). Once they are registered, I want them to be able to change their email adresses to whatever email and domain they want.
When I set up a validation on the email field, this prevents users from changing their email to other domains even after registration.
What would I need to do to allow email-addresses@different.domains after registration only?
Believe the only way you'll be able to have conditional validation like that is to move the validation to PHP. You can do so using Code Validation provided by CB Code Field. Under Integrations > CB Code Field you can enable PHP based custom validation to be applied to your email field where you can then verify the email domain only for registrations. Example as follows.
Code Validation: Enable
Code (PHP):
Code:
if ( $reason !== 'register' ) {
return true; // This skips the validation on all other views except registration
}
return ( $value === 'PASS' ); // Here you can handle verifying the domain name
Ajax Validation: Enable
Note the above is just an example. I cannot help you with custom coding tasks. You will need to implement that verification yourself.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.