November 29th, 2000, 04:35 PM
Is there a good web reference on how to use HTML properly when printing the various form tags as output? For example, print "<b>Hello World.</b>n"; is no problem. However, using print "<FORM blah, blah, blah></FORM>n"; is a problem. Do form elements need to be coded syntactically different than their simpler hmtl bretheren? My Perl references don't seem to cover this.
November 29th, 2000, 04:57 PM
<form> tags are coded the same way all other tags are coded. You place the <form> element around other elements which are then called the form "controls". Those controls are what you use to write a message at this forum. So to code a simple <form> tag in Perl you could use something like this:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
print "<form name="form1" action="script.pl" method="post">n";
Or you can always use the CGI.pm module and its HTML shortcuts...
November 29th, 2000, 06:33 PM
Ahhh, I don't think I was escaping my quotes in the form code when I tried to print them! Perl generated some type of "illegal divide by zero on line x" message when I tried to run my script at the command line. Don't know what that meant, but maybe the lack of escapes had something to do with it. Anyway, thanks for your example. I'll give it a try.
December 4th, 2000, 10:58 PM
Just a little tip: use the qq()
It's not a very known code, but quite handy. It ignores all quotes within it.
You could do something like:
print "qq(<form name="name" action="get.cgi" method="post"> )");
That would work.... I'm actually not sure how to use that code, since I use it so rarely.... but experiment a bit with the qq() function and you'll figure out how to use it
December 5th, 2000, 03:30 AM
Just use it like this:
Its one great function for HTML...