Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Form validation

New Here ,
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

I would like to create a form validation that checks if the input of a certain field contains a number in a specific format. The format should be alphabetic(one character).numeric(two characters).numeric(three characters) ex. A.01.999

How can I achieve this with the form validation in DreamWeaver MX?

Thanks in advance!

Robin Meeuwsen
TOPICS
Server side applications

Views

407
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

Such a specific validation can be done by defining a "regular expression" pattern -- but DW MX built-in "Validate Form" behaviour regretfully doesn´t provide an "apply regular expression" option.

You might want to give some advanced 3rd party form validation extensions a try, some of them let you apply your own pattern (sometimes called "mask").

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

Rmeeuwsen wrote:

> I would like to create a form validation that checks if the input of a certain
> field contains a number in a specific format. The format should be
> alphabetic(one character).numeric(two characters).numeric(three characters) ex.
> A.01.999
>
> How can I achieve this with the form validation in DreamWeaver MX?
>
> Thanks in advance!
>
> Robin Meeuwsen
>
function specialTest(inp){return /^[A-Z]\.\d\d\.\d\d\d$/i.test(inp);}

Let's assume the input is named "codeNumber"

<form ... onsubmit=
"MM_validateForm(...);
return document.MM_returnValue" &&
specialTest(this.codeNumber.value)">

Mick

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2007 Apr 23, 2007

Copy link to clipboard

Copied

Thanks. I'm going to try this one out.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 02, 2007 May 02, 2007

Copy link to clipboard

Copied

LATEST
Rmeeuwsen wrote:

> Thanks. I'm going to try this one out.

<form ... onsubmit=
"MM_validateForm(...);
return document.MM_returnValue &&
specialTest(this.codeNumber.value)">

There was a typo in previous post.
Mick

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines