Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Re: field_filters not working

by bar10der (Beadle)
on May 12, 2004 at 13:47 UTC ( #352728=note: print w/replies, xml ) Need Help??

in reply to Re: field_filters not working
in thread field_filters not working

Hi Thelonius,

I thought its obvious that I am using CGI:Application's validateRM function to validate my form.

As far as how field_filters is failing is concerned, when I am submitting form with non-numeric data in those fields included in filed_filters, the form does not report back error but instead form is submitted. What I am expecting is that formValidator reports error as is does when required fields are left blank or when dependencies are broken.

Replies are listed 'Best First'.
Re: Re: Re: field_filters not working
by Thelonius (Priest) on May 12, 2004 at 13:56 UTC
    The 'digit' filter is supposed to remove non-digit characters from the field, not give an error.

    I think what you want is a constraint.

      Thanks Thelonius,

      I thought only filters command removes non-digit chars and fild_filters are for forcing digits in a field.

      I'll try to write a constraint now. Thanks again.

      Hi, I did write a constraint but looks like I am struck a bit. Here is the code -

      constraints => { smcsystems => qr/^\d+$/,}

      But above is accepting any data - numeric and non-numeric. However if i change code to ->

      constraints => { smcsystems => qr/^\d{3}$/,}

      It does validate data but then I have to enter 3 digits(that is the max length allowed in my form field). Now I am not sure how I can write reg-ex so that it accepts any number of digits but no alpha chars.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://352728]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2021-09-22 23:47 GMT
Find Nodes?
    Voting Booth?

    No recent polls found