Jump to content

Validating client custom fields on registration

Tom Atkinson

Recommended Posts

Hi Tom,

On 03/01/2020 at 18:53, Tom Atkinson said:

I need to check if a custom client field is unique on registration. 

I found https://whmcs.community/topic/68137-check-if-custom-field-value-is-not-used-already-unique/ but that is from 10 years ago?

the last suggestion in that thread, though a little dated coding wise, is still basically what you would need to do.

On 03/01/2020 at 18:53, Tom Atkinson said:

Is there any up to date guidance please?

these days, it would probably need the ClientDetailsValidation hook - using that, you check if the entered custom field value in unique by seeing if the value for that field already exists in the database (specifically the tblcustomfieldvlaues table) - if it exists, you can return an error to tell the user to enter another value... if it doesn't already exist, the validation is passed and the account created.

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.

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