in reply to Can't seem to pass query string with start_form(-action=>"test_form.pl?$url_group")

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');
  • Comment on Re: Can't seem to pass query string with start_form(-action=>"test_form.pl?$url_group")
  • Select or Download Code