I have the following html and CGI subroutine that handles it (uses HTML::Template). I would like to reload the page, switching to another page when the user changes the pull-down menu. This works fine. However, as you can see, there is another parameter, name, that I is included with the POST, but it doesn't show up in the text box unless I explicitly set the VALUE for the textbox to the value of the parameter. I can't seem to see if this is expected behavior or not.

I would like to be able to have the page switch and any other visible parameters on the page be persistent and visible to the user. I would also like to be able to use the reset button for the form to reset the values.

Thanks for the help.
Sean


RELEVANT HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Query Normal Tissue Database</title>
  </head>

<body bgcolor="aquamarine">
<center>
<h1>Full Text Search</h1>
<form method="post" action="/cgi-bin/nltissue.pl" enctype="multipart/form-data" name="myForm">
<!-- TMPL_VAR NAME="HIDDEN" -->
<p><!-- TMPL_VAR NAME="P1" --></p>
<p>
<b>Value to find? (* for a wildcard):</b>
<input type="text" NAME="name" VALUE="<!-- TMPL_VAR NAME="TBNAME" -->"/>
</p>
<p>
<b>What to search for:</b>
<!-- TMPL_VAR NAME="SELECTVAL" -->
</p>
<p>
<input type="submit" name="query_submit"/>
<input type="reset" name="query_reset"/>
</p>


      </form>

<hr>
<address><a href="mailto:[EMAIL PROTECTED]">System Administrator</a></address>
<!-- Created: Wed Jun 23 16:55:17 EDT 2004 -->
<!-- hhmts start -->
Last modified: Wed Sep 8 08:20:01 EDT 2004
<!-- hhmts end -->
</body>
</html>


RELEVANT PERL
sub query_annotation {
  my $self     = shift;
  # Get CGI query object;
  my $q        = $self->query();
  my $template = $self->load_tmpl('query_annotation.html');

$template->param('TBNAME' => $q->param('name')); #I lose name (doesn't show up in textbox unless I do this????
$template->param('P1' => $q->param('selectval') . ' ' . $q->param('type1')); #to see what is going on
$template->param('SELECTVAL' => $q->popup_menu(
-name => 'selectval',
-values => ['Annotation','Image Clone'],
-default=> 'Image Clone',
-onChange=>'javascript:window.document.myForm.rm.value="query_main"; submit(this)',
)
);
$template->param('HIDDEN' => $q->hidden(-name => 'rm', -value => 'mode1'));


  return $template->output;
}


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to