Fellow monks,

I've hit a wall with this problem and I'm not sure if it's something I've inadvertently done or if CGI.pm is having a problem with generating the HTML code.

I'm generating a HTML form using a combination of OO CGI and print statements because as far as I can tell CGI.pm doesn't support the fieldset and label tags as of yet unless I use CGI::FormBuilder. As I'm trying to do my error checking right in Perl I'm not sure that using that module is the way to go since it does the error checking in JavaScript and I'm just setting CSS options to denote unfilled required fields.

Given this pared down code snippet:

sub html_form{ print qq( <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 24 May 2007), see www.w3.org" /> <title>Wright Popcorn &amp; Nut Company</title> <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii" /> <script src="checkbox.js" language="javascript" type= "text/javascript"> </script> <link rel="STYLESHEET" href="cart.css" type="text/css" /> </head> <body> <div id="header"> <h1> Order your Pink Popcorn Here!</H1> <H2>I want to order: &nbsp; &nbsp;Quantity &nbsp; <INPUT TYPE="text" NAME="quan" VALUE="1" MAXLENGTH="2" SIZE="2"> <INPUT NAME="size" TYPE="radio" CHECKED VALUE="50">50/cs <INPUT NAME="size" TYPE="radio" VALUE="100">100/cs </H2> </div> <div>); print $query->start_form(-name => 'scart'); print qq! <div id="center"> <fieldset> <legend>Billing Informtion</legend>!; print qq! <p><label for="billname" class=$id_check{BillName2}>Name</labe +l> <input id="billname2" name="billname2" type="text" value=$params{billname2} ></p> <p><label for="billaddress1" class=$id_check{billaddress14}>Ad +dress</label> <input id= "billaddress14" name="billaddress14" type="text" /></p> <p class="submit"><input value="Place my Order!" type="submit" + /></p> </fieldset> </div>!; print $query->end_form; print qq( </div> </body> </html> ); }

when I put in just the first paramter, it returns the HTML as I would expect, but only the first part of a possible multi part paramter. For example, if I put blah blah in the name field, after the submit just the first blah is returned in the field. However Data::Dumper shows that blah blah is passed as a parameter.

Anybody have a clue why it seems to be clipping the data there?

Update: As <a href="http://www.perlmonks.org/?node_id=522408>olus pointed out I didn't have the double quotes around the value, but it turns out that I didn't need the value there anyway. Apparently the input id and name pieces takes care of that. If I'm incorrect in that reasoning, please let me know.


Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

I would love to change the world, but they won't give me the source code


In reply to HTML Fieldset messing up self referencing CGI? by Popcorn Dave

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.