Validation - Regular Expression

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
dire
User
Posts: 41

Validation - Regular Expression

Post by dire »

Hi,

What I'm doing wrong?

  1. General Option->Client Side Validation ->checked
  2. table Customer->Field (mobila phone)->Validation
    a. Validate ->Regular Expression
    b.Arguments clent-side -> /\(?([0-9]{3})\)?[ ]?([0-9]{3})[ ]?([0-9]{3})$/ (xxx xxx xxx or xxxyyyzzz)
    c.some error text in error mesage.

When I put some dummy number nothing happens? No error message? Any idea?


Webmaster
User
Posts: 9425

Post by Webmaster »

Use double quotes instead of slashes. Try: "^...$" (Replace "..." with your own pattern.)


dire
User
Posts: 41

Post by dire »

No luck with "..." or '....'

When error msg fires? before update/insert or after update/insert?


motfs
User
Posts: 258

Post by motfs »

dire wrote:
When error msg fires? before update/insert or after update/insert?

This is client side. The form will validate first before submitting.

When I put some dummy number nothing happens? No error message? Any idea?

If you enter "ABC" for the field, the form will not submit and an error message will return. Provide what you actually input to test and any error message.


dire
User
Posts: 41

Post by dire »

Ok It works ...

/\(?([0-9]{3})\)?[ ]?([0-9]{3})[ ]?([0-9]{3})$/ <- is the regular expresion

When I submit ABC or other dumy stuff, error msg fires.


Post Reply