Jump to content
mxhostro

Validation for domain additional additionalfields

Recommended Posts

Hello,

 

Please advice me how to implement a custom validation for the additionalfields of a domain that appear when the client whats to register a new domain. I would prefer that the validation occurs when the client tries to go to the next step and blocking him if it's not validated. I've attached some print screen to make it more clear what I need, basically I need to be able to run a PHP script when the client presses "Update Cart" and not go to the next page unless it returns that the validations is ok.

I've been searching now for a while the WHMCS documentation the internet and this community for how to implement this, if I missed a similar topic please point me to it.

validation.PNG

Share this post


Link to post
Share on other sites
4 hours ago, mxhostro said:

Please advice me how to implement a custom validation for the additionalfields of a domain that appear when the client whats to register a new domain. I would prefer that the validation occurs when the client tries to go to the next step and blocking him if it's not validated. I've attached some print screen to make it more clear what I need, basically I need to be able to run a PHP script when the client presses "Update Cart" and not go to the next page unless it returns that the validations is ok.

if you need to validate it on the page, it's going to be jQuery rather than PHP - unless you're saying that you need to send to a PHP file for another reason.

there's no built-in method to do it, so you're looking at adding custom jQuery code in a hook or template... what exactly do you want to validate for .ro domains ??

i'll add in advance that it probably won't be easy to do.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for the swift reply. It doesn't need to be PHP, if it's simpler with JavaScript i'm ok. I'm a novice in this stuff so an simple example would help me a lot.

I need to validate the CNPFiscalCode and Registration Number, the code for the validation itself is not an issue, I just don't know how to integrate it into the page.

Thank you!

Share this post


Link to post
Share on other sites
On 2/13/2018 at 12:05, mxhostro said:

Thank you for the swift reply. It doesn't need to be PHP, if it's simpler with JavaScript i'm ok. I'm a novice in this stuff so an simple example would help me a lot.

the difficulty is that after looking at your website, I can see that you're using custom theme and orderform templates - looks like "Flat" from WHMCSDesigns... so any JS code that might work in Six & Standard_cart might not necessarily work in Flat.

On 2/13/2018 at 12:05, mxhostro said:

I need to validate the CNPFiscalCode and Registration Number, the code for the validation itself is not an issue, I just don't know how to integrate it into the page.

if it were just about length, or a particular format, you might have been able to use a regex pattern with a hook (if so that would work almost regardless of template) - but if the Wikipedia link is correct, then I guess you're looking at doing some calculations on it to verify checksums etc.

now you could make those fields required by updating the additionaldomainfields options, and that would just mean the user would have to enter something in those fields... but I guess you wouldn't want to make both these fields and company ID required as it's one or the other.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines