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 / 1481
1480  |  1482
Subject: 
Re: CGI question
Newsgroups: 
lugnet.off-topic.geek
Date: 
Thu, 6 Apr 2000 23:45:40 GMT
Highlighted: 
(details)
Viewed: 
97 times
  
Paul Foster wrote:

I have the following perl script that I inherited in
a program I am supposed to fix, the perl I understand,
but I'm not really up on Forms..

http://www.thefosterfamily.org/junk.html

Normally, you enter a login and then hit the submit
button and things work well.  If you hit submit with no
text in the login field, the javascript gives you an error
message, but if you leave the login field blank and hit
return, the program goes on leaving the field blank.

How can I check if the user has put data into the login field?

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.

HTH

:)

Dan



Message has 3 Replies:
  Re: CGI question
 
(...) 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 (...) (25 years ago, 7-Apr-00, to lugnet.off-topic.geek)  
  Re: CGI question
 
(...) Reject it on the server end, and serve the form again with an appropriate error message. If you were using the CGI module (1), return an error if (for example) $cgi->param("Vlogin") returns a blank string. Oh, yeah. And don't rely on (...) (25 years ago, 7-Apr-00, to lugnet.off-topic.geek)  
  Re: CGI question
 
(...) Thanks for all the responses from everybody, the final, simplest solution was to add the second text box. As for the javascript, not my choice. This is an internal prog anyways that runs on local, generic login workstations so browser options (...) (25 years ago, 7-Apr-00, to lugnet.off-topic.geek)

Message is in Reply To:
  CGI question
 
I have the following perl script that I inherited in a program I am supposed to fix, the perl I understand, but I'm not really up on Forms.. (URL) you enter a login and then hit the submit button and things work well. If you hit submit with no text (...) (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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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