• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Custom validation for Dutch zipcode

Custom validation for Dutch zipcode 12 years 7 months ago #14832

  • marcovis
  • marcovis's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
Dear all,

I've tried to create a custom validation rule for a dutch zipcode. I've succeeded in getting a rule in the validation.php and I'm able to select it.

However: I think I've got the rule itself wrong:
function nlzipcode($value)		// toegevoegd door M.R. Visser tbv NL-postcode validatie
	{
	return preg_match("/^([0-9]{4})([A-Z]{2})?$/i",$value);
	}

A dutch zipcode is in this format: 9999AA (e.g.: my zipcode is 3723LD).

What did I do wrong?

Regards,
Marco Visser
The administrator has disabled public write access.

Re: Custom validation for Dutch zipcode 12 years 7 months ago #14836

  • barry.jenner
  • barry.jenner's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 3
I have just started learning about this. Why the ? and i before the $value?

Baz
The administrator has disabled public write access.

Re: Custom validation for Dutch zipcode 12 years 7 months ago #14865

  • webcat-solutions
  • webcat-solutions's Avatar
  • OFFLINE
  • Junior Boarder
  • Dutch Joomla specialist
  • Posts: 29
  • Thank you received: 4
Hi Baz,

the i is used for case sensitive checking.

gr,
Chantal
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!