[thelist] Validating Forms with Javascript Disabled

aardvark roselli at earthlink.net
Wed Aug 30 17:42:44 CDT 2000


> From: Gregory.John.Toland at census.gov
> 
> What is the best method to validating form entries with Javascript
> disabled?  I assume I  include the code (that would normally have
> executed on the client side) in the program defined by the ACTION

yes, the script on the server should handle all field validation and 
errors, notifying the user of any problems...

> attribute.  If there is an error in the entry (i.e. form field is
> blank) how do I redirect the user back to the page containing the
> form, but without resetting all the fields to blank (i.e. any fields
> with entries retain their values)?  Any advice or web sites with
> examples?  Thanks so much for any help you could give.

my scripts contain all 'pages' in one script... i just have some logic 
that walks the user through based on an 'action' (<input 
type="hidden" name="action" value="getCCinfo">, for example)...

also, all my form fields have server-side script to capture any pre-
entered fields and display the data in the form field (for ASP, that is 
<input type="text" ... name="foo" value="<% = Request("foo") 
%>">, assuming i haven't defined my variables already)...

whenever a user has an error, i redraw the current page and 
highlight the field with an error...

for example:
http://herdaboutbuffalo.com/merchandise/

...add a product, and try to submit without filling out required info.  
it should redraw the page and present errors...





More information about the thelist mailing list