When you use the CGI code you posed, the initial HTML generated does this:

<form method="post" action="test_form.pl?" enctype="multipart/form-data">
<input type="submit" name=".defaults" tabindex="1" value="This doesn't pass the group" />
</form>

So what youre getting is a form submitted via post, that contains a submit button with name .defaults and a value of "This doesn't pass the group". The fact that it's a post partly explains why you aren't getting the values; you don't have an HTML element that the default can be applied to. I think you might have been relying on this section of the CGI documentation:

print defaults('button_label')

You don't need that, because that code creates a button that generates all the default values for the HTML elements, like lists, radio buttons, and the like.

You also don't want to put a question mark and a value after the action name, because that's an (incorrect) attempt at a get type query, where you have script_name?var1=val1&var2=val2 and so forth

print $query->hidden(-name => 'url_group', -default => $query->param('url_group'));

should be what you want. And make the action just be test_form.pl. Hope that helps. And for the button you want, just use:

print $query->submit('This does pass the group');

In reply to Re: Can't seem to pass query string with start_form(-action=>"test_form.pl?$url_group") by Sinistral
in thread Can't seem to pass query string with start_form(-action=>"test_form.pl?$url_group") by memnoch

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.