Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How to validate the form in CGI

by mkirank (Chaplain)
on Mar 08, 2005 at 12:04 UTC ( #437506=note: print w/replies, xml ) Need Help??


in reply to How to validate the form in CGI

Check out CGI Docs

#!perl use CGI qw(:standard); use strict ; use warnings; my $query = new CGI; print $query->header; print start_html(-title=>"hello world", -bgcolor=>"#BOE0E6" ); my $js =<<JS; <SCRIPT Language="javascript"> function check_answer() { if(document.hello.empcode.value==false) { alert("Please enter the Software"); document.hello.empcode.focus(); return false; } return true; } </SCRIPT> JS print "$js \n\n"; print $query->startform(-method=>"POST",-action=>"mycgi.cgi",-onSubmit +=>'return check_answer()',-name=>'hello'); print $query->textfield(-name=>'empcode', -size=>20, -maxlength=>20); print $query->submit(-name=>'submit', -value=>'submit'); print $query->reset ; print $query->endform;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://437506]
help
Chatterbox?
[Discipulus]: ahi ahi ahi!!
[Lady_Aleena]: paco is a little over 2 years before my time.
[Discipulus]: you can try tachyon's iterative approach Re: Win32 Recursive Directory Listing
[Lady_Aleena]: I'm on Linux/
[beech]: isn't 2 year about standard recovery time for that kind of surgery?
[Discipulus]: if you hate FIle::Find
[Lady_Aleena]: I don't hate it, it just drives me crazy.
[Discipulus]: LA the solution is portable to whatever

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2017-04-23 20:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.