Development Software
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementDevelopment Software

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 26th, 2004, 01:35 AM
RosaAeterna's Avatar
RosaAeterna RosaAeterna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: soCAL
Posts: 197 RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level)RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level)RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level)RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level)RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 7 h 22 m 2 sec
Reputation Power: 20
Best way for Server Side Form Validation?

I usually create an error array and upon an invalid field, I add to the array. If there is anything in the array, I generate an appropriate message and take the user back to the original form.

Another way is to just write little procedures to check each field. Upon an invalid field, that procedure is executed. This method does not capture all the errors at once and usually takes the user back to the same old form for each mistake.

Anyone else w/ a different/better approach?

Reply With Quote
  #2  
Old August 26th, 2004, 08:29 PM
medialint's Avatar
medialint medialint is offline
spirit duplicator
Click here for more information.
 
Join Date: Apr 2004
Location: \\Firecrate\
Posts: 12,183 medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 229770 Folding Title: Super Ultimate Folder - Level 1Folding Points: 229770 Folding Title: Super Ultimate Folder - Level 1Folding Points: 229770 Folding Title: Super Ultimate Folder - Level 1Folding Points: 229770 Folding Title: Super Ultimate Folder - Level 1Folding Points: 229770 Folding Title: Super Ultimate Folder - Level 1Folding Points: 229770 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 2 Weeks 5 Days 1 h 54 m
Reputation Power: 2497
Well, make a hash and use a flag. Check each field and if the value is invalid, set the value in the hash to some error identifier (eg Null) and set the flag. At the end, if you have a flag, rewrite the form where you can on the form generation process do the familiar RED font effect on the field name along with any descriptive. The form, naturally, populates the existing (valid) values.

Reply With Quote
  #3  
Old August 27th, 2004, 03:46 PM
RosaAeterna's Avatar
RosaAeterna RosaAeterna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: soCAL
Posts: 197 RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level)RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level)RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level)RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level)RosaAeterna User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 7 h 22 m 2 sec
Reputation Power: 20
Quote:
Originally Posted by medialint
Well, make a hash and use a flag. Check each field and if the value is invalid, set the value in the hash to some error identifier (eg Null) and set the flag. At the end, if you have a flag, rewrite the form where you can on the form generation process do the familiar RED font effect on the field name along with any descriptive. The form, naturally, populates the existing (valid) values.


Hmm, I like that approach. Users need to be told what they're missing on the page where they forgot to put the info.

Thanks. And cool, you're in SF. =)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementDevelopment Software > Best way for Server Side Form Validation?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway