Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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;

Comment on Re: How to validate the form in CGI
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://437506]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-10-10 14:38 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls