Validation - Regular Expression

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.

Validation - Regular Expression

Postby dire » Thu Nov 23, 2017 3:31 am

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?
dire
 
Posts: 34
Joined: Mon Sep 26, 2016 7:53 pm

Re: Validation - Regular Expression

Postby Webmaster » Thu Nov 23, 2017 10:37 am

Use double quotes instead of slashes. Try: "^...$" (Replace "..." with your own pattern.)
Webmaster
 
Posts: 10733
Joined: Fri Aug 06, 2004 5:59 pm

Re: Validation - Regular Expression

Postby dire » Thu Nov 23, 2017 12:32 pm

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

When error msg fires? before update/insert or after update/insert?
dire
 
Posts: 34
Joined: Mon Sep 26, 2016 7:53 pm

Re: Validation - Regular Expression

Postby motfs » Fri Nov 24, 2017 11:10 am

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.
motfs
 
Posts: 710
Joined: Tue Sep 08, 2015 4:55 pm

Re: Validation - Regular Expression

Postby dire » Fri Nov 24, 2017 4:50 pm

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.
dire
 
Posts: 34
Joined: Mon Sep 26, 2016 7:53 pm


Return to General Discussion (ASP.NET Maker)