Spry Javascript Duplicated values when typing

129 Views Asked by At

I need to validate PHP form using Spry and below is the javascript I used. The validation rule is: 9 digits followed by a literal 'v'. Validation works, but when entering some numbers are duplicated.

var id_num1 = new Spry.Widget.ValidationTextField(
    "id_num1",
    "custom",
    {
        pattern: "000000000v",
        useCharacterMasking: true,
        validateOn: ["blur"],
        isRequired:true
    });

If anyone help me to solve this issue.

1

There are 1 best solutions below

0
On

Try:

var id_num1 = new Spry.Widget.ValidationTextField(
    "id_num1",
    "custom",
    {
        format:"custom",
        pattern: "000000000v",
        useCharacterMasking:true,
        validateOn:["blur"], 
        isRequired:true
    });

And if it doesn't work, please be more precise in what is happening.