I can't find see an immediate problem with your code, but chances are I'm
overlooking something. A simple solution might be to pass the
'die_on_bad_params' => 0, argument to your HTML::Template->new() statement.

A question about your choice of creating forms though. Why are you writing
so much perl code to output html code, when it appears that your desired
html is simple enough to be created in html. You're adding an extra level of
abstraction that doesn't immediately (to me) seem necessary.

It looks like the only dynamic aspect to your template is the $switches
array which could easily be inserted into the template via a TMPL_LOOP. You
could cut your perl code down from 29 lines to about 5. And you wouldn't
really be adding many more lines to the template, just a couple more
characters per line then what's already there.

Generally the only time I'll use CGI.pm to generate form fields are when I'm
writing a simple program that isn't using ANY templates at all, or if I'm
creating LOTS of form elements dynamically.


> Heh.  Weird.  definitely.
>
> > maybe.  can you post a bit of the relevent code from the general
vicinity of
> > line 84?
>
> Here you go:
>
>     # Get switch IP addresses (Array Reference)
>     my $switches = get_exclude_ports_switches($dbh);
>
>     # Get text of hidden variables controlling where to go next
>     my $rm_add = $q->hidden(-name=>'rm', -default=>'add_switch');
>     my $rm_ep = $q->hidden(-name=>'rm', -default=>'exclude_ports');
>     my $rm_cp = $q->hidden(-name=>'rm', -default=>'config_ports');
>     my $submit = $q->submit(-name=>'Go');
>
>     # Switch IP entry field
>     my $af = $q->textfield(-name=>'switch_ip',
>                            -override=>1,
>                            -size=>15,
>                            -maxlength=>15);
>
>     # Popup list of switch IP addresses
>     my $ss = $q->popup_menu(-name=>'switch_ip',
>                             -values=>$switches,
>                             -default=>$$switches[0]);
>
>     # Load template
>     $main_tmpl->param(startform => $q->start_form(),
>                       endform => $q->end_form(),
>                       run_mode_add => $rm_add,
>                       run_mode_ep => $rm_ep,
>                       run_mode_cp => $rm_cp,
>                       submit => $submit,
>                       addfield => $af,
>                       switch_select => $ss);
>
> The call to $main_tmpl->param(...) is line 84.
>
> I'm attaching the template file.  Could I be running into some caching
> issue with mod_perl?
>
> --[Lance]
>
> -- 
>   Carolina Spirit Quest:  http://www.carolinaspiritquest.org/
>   Celebrate The Circle: http://www.angelfire.com/nc/celebratethecircle/
>   My LiveJournal: http://www.livejournal.com/users/labrown/
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to