Fog Creek Software
Discussion Board




ASP forms

Hi

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

https://shop.fogcreek.com/?sCategory=FogBUGZ

indeed
Wednesday, August 06, 2003

http://wdvl.internet.com/Authoring/ASP/FormHandling/blank_fields.html

here
Wednesday, August 06, 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")
unignore


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 07, 2003

*  Recent Topics

*  Fog Creek Home