Fog Creek Software
Discussion Board

ASP forms


Can someone tell me where i can find a sample code that does the validation like the following form:

Wednesday, August 6, 2003

Wednesday, August 6, 2003

if you break it down into stages:

stage one, gather form vars

a function that reads all the form vars

each one doing this
ignore error
    var = request("fieldname")

stage two, report invalid form vars based on business rules, if there are objectionable data.. you'll probably show the form again.. so assign some asp template vars

each one doing this
if bad_condition_a(var) then
    alarm = true
    complaints = complaints + complaint_a
    editable_var_a = var_a
end if

if bad_condition_b(var) then
    alarm = true
    complaints = complaints + complaint_b
    editable_var_b = var_b
end if

and so on

at this point.. you get either decide to accept the data
or spit back out the same form again

if it's good (alarm = false) then go to your next step

if it's bad (alarm = true)

write out the same edit form (but also print out complaints)

Li-fan Chen
Thursday, August 7, 2003

*  Recent Topics

*  Fog Creek Home