Handling large form submissions

Discussion in 'ASP General' started by Michael, Dec 10, 2003.

  1. Michael

    Michael Guest

    Does anyone have any ideas about how I can go about this faster.

    I have a large form that is being submitted, and from that a new row in a
    database will be created. I'm working on the page that will error check
    whatever they send before it gets put in the database. I just want to do
    pretty basic things, make sure numbers are really numbers, text length
    doesn't go past the length specified in the database, etc.

    My problem is, I'm stuck going through about 70 Request.Form("myvar") and
    applying the checks. Makes for lots of coding i'd rather not waste my time
    on.

    Does anyone have any ideas for making this process faster?

    Thanks
    --Michael
    Michael, Dec 10, 2003
    #1
    1. Advertising

  2. Michael

    Bob Barrows Guest

    Michael wrote:
    > Does anyone have any ideas about how I can go about this faster.
    >
    > I have a large form that is being submitted, and from that a new row
    > in a database will be created. I'm working on the page that will
    > error check whatever they send before it gets put in the database. I
    > just want to do pretty basic things, make sure numbers are really
    > numbers, text length doesn't go past the length specified in the
    > database, etc.
    >
    > My problem is, I'm stuck going through about 70 Request.Form("myvar")
    > and applying the checks. Makes for lots of coding i'd rather not
    > waste my time on.
    >
    > Does anyone have any ideas for making this process faster?
    >
    > Thanks
    > --Michael


    Break the form up into smaller bits? You'll still need to write the code to
    validate all 70, but there will probably be less impact on the user.
    Consider this: the user inputs data into 65 of the input fields and
    something happens before the form is submitted - the computer/browser
    crashes, a power failure, etc. So now you have a frustrated user who has to
    enter all 65 pieces of data again! Not cool.

    Better would be to put related sections of the data into their own forms.
    When the user hits continue,. the data from the smaller form gets saved
    before going on to the next form. That way, if the process gets interrupted,
    the user can start off where he left off, only having to re-enter a smaller
    amount of data.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows, Dec 10, 2003
    #2
    1. Advertising

  3. Make the names of your form fields significant. The method I use is as
    follows:

    fld t Firstname
    fld t Lastname
    fld n Age
    fld d Birthdate

    fld = this is a field I want to work with
    t = text field
    n = numeric field
    d = date field

    On form submit, it's a simple matter, then, to write a javascript loop that
    looks for the "fld" and decides how to validate based on {t|n|d}. Error
    messages are collected, concantenated together, then displayed at the end.
    If there are no messages, the function returns true and the form submits.

    This same method can be used server side to write insert and update sql
    statements. Changes to forms require no rewrite of any of the processing
    code as long as the new fields follow the convention.

    - Wm


    --
    William Morris
    Product Development, Seritas LLC



    "Michael" <raterus@localhost> wrote in message
    news:...
    > Does anyone have any ideas about how I can go about this faster.
    >
    > I have a large form that is being submitted, and from that a new row in a
    > database will be created. I'm working on the page that will error check
    > whatever they send before it gets put in the database. I just want to do
    > pretty basic things, make sure numbers are really numbers, text length
    > doesn't go past the length specified in the database, etc.
    >
    > My problem is, I'm stuck going through about 70 Request.Form("myvar") and
    > applying the checks. Makes for lots of coding i'd rather not waste my

    time
    > on.
    >
    > Does anyone have any ideas for making this process faster?
    >
    > Thanks
    > --Michael
    >
    >
    William Morris, Dec 10, 2003
    #3
  4. Michael, I like that idea. I've used the same idea for
    forms where I have multiple checkboxs, etc. but never
    thought about doing that for validation.

    Thanks for the tip.
    John



    >-----Original Message-----
    >Michael wrote:
    >> Does anyone have any ideas about how I can go about

    this faster.
    >>
    >> I have a large form that is being submitted, and from

    that a new row
    >> in a database will be created. I'm working on the page

    that will
    >> error check whatever they send before it gets put in

    the database. I
    >> just want to do pretty basic things, make sure numbers

    are really
    >> numbers, text length doesn't go past the length

    specified in the
    >> database, etc.
    >>
    >> My problem is, I'm stuck going through about 70

    Request.Form("myvar")
    >> and applying the checks. Makes for lots of coding i'd

    rather not
    >> waste my time on.
    >>
    >> Does anyone have any ideas for making this process

    faster?
    >>
    >> Thanks
    >> --Michael

    >
    >Break the form up into smaller bits? You'll still need to

    write the code to
    >validate all 70, but there will probably be less impact

    on the user.
    >Consider this: the user inputs data into 65 of the input

    fields and
    >something happens before the form is submitted - the

    computer/browser
    >crashes, a power failure, etc. So now you have a

    frustrated user who has to
    >enter all 65 pieces of data again! Not cool.
    >
    >Better would be to put related sections of the data into

    their own forms.
    >When the user hits continue,. the data from the smaller

    form gets saved
    >before going on to the next form. That way, if the

    process gets interrupted,
    >the user can start off where he left off, only having to

    re-enter a smaller
    >amount of data.
    >
    >Bob Barrows
    >
    >--
    >Microsoft MVP -- ASP/ASP.NET
    >Please reply to the newsgroup. The email account listed

    in my From
    >header is my spam trap, so I don't check it very often.

    You will get a
    >quicker response by posting to the newsgroup.
    >
    >
    >.
    >
    John Beschler, Dec 10, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Diane Selby
    Replies:
    4
    Views:
    6,760
  2. Matty Sarro

    Automated form submissions

    Matty Sarro, Oct 21, 2011, in forum: Python
    Replies:
    1
    Views:
    140
    Grant Edwards
    Oct 21, 2011
  3. Sandra G
    Replies:
    1
    Views:
    181
    Ray Costanzo [MVP]
    Jul 28, 2005
  4. Replies:
    0
    Views:
    153
  5. Dan Quill
    Replies:
    0
    Views:
    101
    Dan Quill
    Apr 2, 2004
Loading...

Share This Page