By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,608 Members | 3,801 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,608 IT Pros & Developers. It's quick & easy.

Handling large form submissions

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
Jul 19 '05 #2

P: n/a
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:eW**************@TK2MSFTNGP10.phx.gbl...
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

Jul 19 '05 #3

P: n/a
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 tovalidate all 70, but there will probably be less impact on the user.Consider this: the user inputs data into 65 of the input fields andsomething happens before the form is submitted - the computer/browsercrashes, a power failure, etc. So now you have a frustrated user who has toenter 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 savedbefore 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 smalleramount of data.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my Fromheader is my spam trap, so I don't check it very often. You will get aquicker response by posting to the newsgroup.
.

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.