i have doubt regarding how to insert html and java script code inside perl.. i have tried this code it is creating html page and showing web page in IE but it is not working (after creation )dynamically... i have one more question regarding this if i run this as "name.html"this is giving out put only on firefox not in IE,can any body tell me the reason why it is behaving like that.. thanks.
#!d:/perl/bin/perl print "Content-Type: text/html\n\n"; print "<html> <head>\n"; print "<body>\n"; print "<script type=\"text/javascript\">\n"; print "function changedays(x) {\n"; print " var y=x;\n"; print " if(y == \"February\"){\n"; print " document.getElementById(\"3\").style.visibili +ty=\"hidden\";\n"; print " document.getElementById(\"4\").style.visibili +ty=\"hidden\";\n"; print " }\n"; print " else{\n"; print " document.getElementById(\"3\").style.visibili +ty=\"visible\";\n"; print " document.getElementById(\"4\").style.visibili +ty=\"visible\";\n"; print " }\n"; print "}\n"; print " </script>\n"; print " </head> \n"; print " <body bgcolor=\"lightgreen\">\n"; print " <p style=\"font-family:verdana;font-size:75%;colo +r:red\">\n"; print " <center>\n"; print " <p style=\"font-family:verdana;font-size:250%;col +or:red\"> <b>Day/Weekly Activity Report</b>\n"; print "</p>\n"; print "<TABLE BORDER=0 cellspacing=20>\n"; print " <center>\n"; print "<b>Month:</b>\n"; print "<select name=\"month\" id=\"res\" onchange=\"change +days(this.options[this.selectedIndex].value)\">\n"; print "<option value=\"january\">January</option>\n"; + print "<option value=\"February\">February</option>\n"; + print "<option value=\"March\">March</option>\n"; + print "</select>\n"; print "<b>Date:</b>\n"; print "<select name =\"fromdate\" id=\"rest\" >\n"; + print "<option id=\"1\">1</option>\n"; print "<option id=\"2\">2</option>\n"; print "<option id=\"3\">3</option>\n"; print "<option id=\"4\">4</option>\n"; print "</select>\n"; print "<input type=\"submit\" value=\"Submit\">\n"; print "</TABLE>\n"; print "</body>\n"; print "</html>\n";

In reply to insert html with javascript inside perl by kirankumar

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.