Jump to content

Need some help with an action hook


Milliment

Recommended Posts

Hi guys i wonder if anyone can help me with this,

 

In italy we need to take a Codice Fiscale (National insurance number or Social Security) for any orders.

 

Now before i desided to use WHMCS i was developing my own system but gave up as i dident have the time to do it.

 

Anyway i wrote a function that would check if the Codice Fiscale was the correct make.

 

Now here is my origional script

 

 function valid_cf($str)

{

	return ( ! preg_match ( "/^[a-zA-Z]{6}[0-9]{2}[a-zA-Z][0-9]{2}[a-zA-Z][0-9]{3}[a-zA-Z]$/", $str ) ) ? FALSE : TRUE;

}

 

Can anyone help convert it into a working action hook please.

 

Thanks

Anthony

Link to comment
Share on other sites

I don't think an actionhook is necessary for what you're trying to accomplish. In fact, it may be overkill. My suggestion would be to create a custom client field and use your regex string for validation, which can be pasted right into the validation box when creating the field.

Link to comment
Share on other sites

  • 1 month later...

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