#!/usr/bin/perl use strict; use warnings; use CGI; my $cgi = CGI->new(); print STDOUT "Content-type: text/html\n\n"; print "<html>\n"; print "<head>\n"; print "<script type='text/javascript'>\n"; print "function CheckForm_onclick() \n"; print "{\n"; print "var myForm = document.form1;//document.getElementById(\"form1\" +)"; print "var message = \"\""; print "alert(1)"; print "if (myForm.userid.value == \"\") {"; print "alert(1)\n"; print "message = \"Please enter your user id.\"\n"; print "}\n"; print "alert(message)\n"; print "if (message != \"\") {\n"; print "alert(message)\n"; print "return(false)\n"; print "}\n"; print "else {\n"; print "return(true)\n"; print "}\n"; print "}\n"; print "</script> \n"; print "<title>Ticket Purchases for Special Events</title>"; print "</head>"; print "<body>"; print "<form id=\"form1\" name=\"form1\" >"; print "<table><td><p>User ID: <input type=\"text\" name=\"userid\" val +ue=\"\" size=\"7\">"; print "<input type='Button' id='val' value='View' align='middle' oncli +ck=\"CheckForm_onclick()\" ></p></td></table></form>"; print "</body>"; print "</html>";
In reply to Re^2: (OT) onClick event in cgi not workling
by aurora26
in thread (OT) onClick event in cgi not workling
by aurora26
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |