[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[mv] Re: MV 4.04a - checking form for numeric value
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]
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