Phone number field

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sagmag
User
Posts: 182

Phone number field

Post by sagmag »

Is there away to setup a field to receive phone number?


sangnandar
User
Posts: 980

Post by sangnandar »

What's the trouble?
Phone number is just an INT datatype, right?
Please explain more.


arbei
User
Posts: 9284

Post by arbei »

Use text field and use "Regular Expression" as validation in order to make sure the Phone number is in your expected format.


sagmag
User
Posts: 182

Post by sagmag »

But where and how will I put the regex so that the validation can be done on client and server. If there is an error on client the red color on the edges of the fields must be shown?


arbei
User
Posts: 9284

Post by arbei »

sagmag wrote:
But where and how will I put the regex so that the validation can be done
on client and server. If there is an error on client the red color on the
edges of the fields must be shown?

  1. Enable the option "Client-side (JavaScript)" in [PHP] -> [General Options] -> [Validation].
  2. Set up [Edit Tag] of the field as "Text".
  3. In [Edit Tag] -> [Validation] -> [Validate] as "Regular Expression".
  4. Enter your expression in [Argument (client side)].
  5. Enter your error message.

You can also use [Client Script] -> [Form_CustomValidate] of the Edit Page or Add Page to validate the field.
Read help file topic: "Server Events and Client Scripts" -> "Client Scripts" -> "Form_CustomValidate" for more information.


Post Reply