Jump to content

Where to add form field validation regex please?


postcd

Recommended Posts

it's depends what type of custom field you want to validate...

 

http://docs.whmcs.com/Custom_Fields#Types_of_Custom_Fields

 

Client Custom Fields

You 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. :idea:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated