srins has asked for the wisdom of the Perl Monks concerning the following question:
where i will be passing this to template file.tc_add_templ will have data for form field in template ie name and value pairs in my template form elements. in add.tmpl file i will have data like thismy add.cgi will be like this, my $component=$query->param('component'); my $ccc_id=$query->param('ccc_id'); my %data = ( ccc_id => $ccc_id, component_name => $component, add => \@tc_add_templ ); my $template = Template->new({ }); $template->process($file,\%data) || die $template->error();
In AddTemplateResult.cgi i will be getting results and store it in hash<form action="AddTemplateResult.cgi" method="get" bgcolor="#e6ede7"> [% FOREACH element = add %] [% IF element.req == "all" %] <input type="text" name="[%element.name %]" value="[%element.default +%]" size="58">
where i will be pasing this hash to anther perl file for processing and add the recpective data in an repositry.@names=$query->param(); foreach $key (@names) { $val=$query->param("$key"); $hoh{$key}=$val; }
when i am using same cgi file for both passing the values and retriving the result.I am getting error in that.<form action="add.cgi" method="get" bgcolor="#e6ede7">
but it is not working in the manner i expected.Any idea how to check these condtions in my code.how to change my code according to problem.if(ref eq " "){ pass the data to template ; } else { result data code; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to pass the value to template and retrive the result from same cgi file.
by eric256 (Parson) on Nov 18, 2005 at 14:02 UTC | |
|
Re: how to pass the value to template and retrive the result from same cgi file.
by jesuashok (Curate) on Nov 18, 2005 at 08:57 UTC |