[dw-free] make 'state' a non-required field for non-US/non-Canada countries
[commit: http://hg.dwscoalition.org/dw-free/rev/108599c7bc5f]
http://bugs.dwscoalition.org/show_bug.cgi?id=2530
Don't require states for non-US/CA orders. Some countries don't have states
or provinces.
Patch by
mark.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2530
Don't require states for non-US/CA orders. Some countries don't have states
or provinces.
Patch by
Files modified:
- htdocs/shop/entercc.bml
--------------------------------------------------------------------------------
diff -r e0b133ed81ff -r 108599c7bc5f htdocs/shop/entercc.bml
--- a/htdocs/shop/entercc.bml Wed Apr 14 16:42:56 2010 -0500
+++ b/htdocs/shop/entercc.bml Sun Apr 18 21:48:12 2010 +0000
@@ -157,9 +157,8 @@ body<=
# if US, then US state must be selected
$err{state} = $ML{'.error.required'}
- if $in{country} eq 'US' && $POST{usstate} !~ /^\w\w$/;
- $err{state} = $ML{'.error.required'}
- if $in{country} ne 'US' && $POST{otherstate} !~ /\S/;
+ if ( $in{country} eq 'US' && $POST{usstate} !~ /^\w\w$/ ) ||
+ ( $in{country} eq 'CA' && $POST{otherstate} !~ /\S/ );
# if there are any errors in fields (some required but not given) then
# we return to handle the form now
--------------------------------------------------------------------------------
