Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date ][Interchange by thread ]

Re: [mv] Re: MV 4.04a - checking form for numeric value



At 04:28 PM 06/11/2001 -0400, you wrote:

>I have been trying to setup a check_forms type routine using [set]
>and mv_check and the results are coming up all wrong.  I have used
>mv_check before for simple variable existance checking but not for
>a explicit and somewhere I must be overlooking something.
>
>My set is as follows:
>
>
>[set check_form]
>         [if explicit]
>         [condition]
>          $maxpricez = '[value booking_maxprice]';
>           return 1 if $maxpricez =~ /[0123456789\.]?/;
>          return 0;
>         [/condition]
>             mv_nextpage=cards
>         [else]
>             form_errors=Bad Max Price entered
>             mv_nextpage=@@MV_PAGE@@
>         [/else]
>         [/if]
>
>[/set]

Other possible problems aside, I think your regex is tripping you up. Try 
it this way:

         [if explicit]
         [condition]
          $maxpricez = '[value booking_maxprice]';
           return 0 if $maxpricez =~ /[^0123456789\.]/;
          return 1;
         [/condition]
             mv_nextpage=cards
         [else]
             form_errors=Bad Max Price entered
             mv_nextpage=@@MV_PAGE@@
         [/else]
         [/if]

- Ed L.




>and later in the [form] I collect the input with :
>
><INPUT NAME=booking_maxprice    SIZE=15 VALUE="[value booking_maxprice]">
>
>
>I am just trying to make sure that ONLY numbers OR  periods are in the
>field. But no matter how I change the above it will not produce
>different results if I put letters or numbers. I fiddled with the perl
>in all sorts of ways but no go.
>
>I am guessing my perl is off or something else is amiss.
>
>Anyone have a simple numeric/period type  checker for <input> in a form ??
>Something more robust is appreciated.
>
>Thanks !!
>
>_______________________________________________
>Minivend-users mailing list
>Minivend-users@lists.akopia.com
>http://lists.akopia.com/mailman/listinfo/minivend-users

===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================

_______________________________________________
Minivend-users mailing list
Minivend-users@lists.akopia.com
http://lists.akopia.com/mailman/listinfo/minivend-users


Search for: Match: Format: Sort by: