postcd Posted April 5, 2016 Share Posted April 5, 2016 Hello, i found i can use regex for the field validation: http://docs.whmcs.com/Custom_Fields#Regular_Expression_Validation But nowhere i can see where to isert this regex. Which file it is or example of how to integrate field validation. In my case i want to validate phone format is correct, domain registar needs 10 digits. Thank You 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 5, 2016 Share Posted April 5, 2016 it's depends what type of custom field you want to validate... http://docs.whmcs.com/Custom_Fields#Types_of_Custom_Fields Client Custom FieldsYou can create client profile related fields in Setup > Custom Client Fields. These can be set to Show on Order Form if you want the client to enter them or left as admin area only for private entries. The client can view and edit the field values from the client area unless they are set to admin only. Product Custom Fields Products you create can also have custom fields added to them which are then shown to the user during the order process. This allows you to collect further information specific to an individual product. These are set when configuring a product in Setup > Products/Services > Products/Services > Edit > Custom Fields tab . Some modules require specific fields are setup and will be explained in the documentation for that module. Support Custom Fields Custom fields for support are set per department and allow you to ask users for additional information when opening tickets. This is often used for things such as current usernames & passwords, etc... These are configured in Setup > Support > Support Departments > Edit > Custom Fields tab so if you take a client custom field as an example, if you go to Setup->Custom Client Fields, you will see a "Validation" box for each custom field - you can put your regex code in there. 0 Quote Link to comment Share on other sites More sharing options...
postcd Posted April 5, 2016 Author Share Posted April 5, 2016 Setup->Custom Client Fields i would like validation for the telephone number field (default one) when client register or edit his profile. Please kindly reply accordingly as i think your message is not related to what im looking for. Im looking to validate existing field not some new one (custom field)? If im wrong, please kindly correct me on what to do. Thank you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 5, 2016 Share Posted April 5, 2016 you can't use the validation technique mentioned in the custom fields documentation on existing fields. some possible workarounds would include removing the phone number from the form and using a custom field instead - that could then be validated as per above; you could use jQuery code to validate the phone number field in the appropriate template or you could use an action hook (ClientDetailsValidation) and code your telephone validation into it. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.