"onClick " not working...!!! this is my complete code...please help me sort this problem
#!/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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.