To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 1482
1481  |  1483
Subject: 
Re: CGI question
Newsgroups: 
lugnet.off-topic.geek
Date: 
Fri, 7 Apr 2000 00:11:52 GMT
Highlighted: 
(details)
Viewed: 
103 times
  
Dan Boger wrote:

well, not sure how you can do it with java, but you shouldn't rely on
java for form validation anyhow - it's unreliable, and easily overcome.
If you had to, you could add another text field, in which case enter
won't submit the form, and you'd have to use the submit button.

I agree that JavaScript really isn't the best way to validate this.  As
long
as you're doing CGI, why not do a POST to the same script, evaluate,
the answers, and complain if they're not any good?

With regards to the multiple fields, I think he's only running into
problems
if someone submits only a string of spaces.  The string length check
should
eliminate people hitting <ENTER> without typing...

Anyhow, a way to do this (I think; I've tried to avoid JavaScript) is
to split on spaces, then compare the length of the resulting array with
the
initial length.  Or you could traverse through the string character by
character and set a flag if a non-space is found...

Let me know if you need more details...

Chris


--
Remove the nospam machine name in my email address to send a personal reply.



Message is in Reply To:
  Re: CGI question
 
(...) well, not sure how you can do it with java, but you shouldn't rely on java for form validation anyhow - it's unreliable, and easily overcome. If you had to, you could add another text field, in which case enter won't submit the form, and you'd (...) (25 years ago, 6-Apr-00, to lugnet.off-topic.geek)  

14 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR