Here the code (is this what you wanted ?) but from Mel's reply looks like
the problem could be the "endform" 


use strict;
use CGI qw(:standard :all *table);
use vars qw($dbh $REQUEST) ;    # global !
use DBI;
use Cwd;
my $CGI_HOME=cwd();        # get $home
# use lib "/opt/common/html/actual/cgi-bin/Library";
use lib "Library";
require MyConnect;
use MyCategories;
#
#   (keywd,value) for estimates are:
#       FY=30-Jun-YYYY  - The fiscal year of the Estimate
#       ACCT=varchar2(15)   - Account to Input/View
#       CUST_ID=number(10)  - Customer to View, ACCT will be <undef>
#       ACTION=(<ACCOUNT>,CUSTOMER) - What type of Action is required
#           if ACTION is by CUSTOMER then nothing to UPDATE
#       INITIAL=(<NO>,YES)      - If "YES" or exist then display "blank form
#       TYPE=(SUBMIT,NEXT)  - If "NEXT" display ONLY - this "hidden" value
#                           will be set by client side script
#
#   To display the initial form from the call line enter the url plus:
#   &INITIAL=YES. This will display a "blank" form PLUS and explanation.
#   defining expected values ... will replace with "submitted"
#
my %REQUEST = (FY       =>'',
            ACCT    =>'',
            CUST_ID=>'',
            ACTION  =>'ACCOUNT',
            VIEW    =>'CATEGORY',
            INITIAL =>'');
        my $q=new CGI;
#
my $status; # the results of request
#
#   return "submitted" values, replacing default if present ...
#
foreach ($q->param) {
    $REQUEST{"$_"}=$q->param("$_");
}
if ($q->param('INITIAL') eq 'YES') {
    $REQUEST{INITIAL}='YES';
    BuildForm();
    }
else {
    $REQUEST{INITIAL}='NO'; 
    ProcessForm();
# my (@request,$keywd);
# @request=$main::q->param;
#   foreach $keywd (@request) {
#       print $q->header(-type=>"text/html"),
#       $q->start_html('Dump of Estimates by TechDirect');
#       print $q->dump();
#       print '<P>My values are:<BR>';
#       my $keywd;
#       foreach $keywd (keys %REQUEST) {
#           print "$keywd = $REQUEST{$keywd}<BR>";
#           }
#       print $q->end_html;
    }
# ===========
sub BuildForm {
use strict;
use MyYTD;
use MyEstbyCat;
my (%YTD, %EST, %CATEGORY, %PRODUCT);
my ($YTD, $EST, $CATEGORY, $PRODUCT);
my $q=new CGI;
print $q->header("text/html"),
#   '<HTML><HEAD><TITLE>Estimates by TechDirect</TITLE>',
#   '<BASE NAME=main>',
#   '</HEAD><BODY>';
    $q->start_html({-title=>'Estimates by TechDirect',-base=>'main'});
print "\n";
#
#   form for navigation, initial and subsequent request to
#   see another account or customer ...
#
print $q->startform({-target=>"main"}),
    center(h3('TechDirect Estimates'));
print "\n";
my ($fy,$database, @setup, %sth, $category, $ytd, $est);
my ($title,$acct,$cust_id,$status,$year,$prev_fy);
$title='';
$acct='';
$cust_id='';
#
#   Example & Explanation:
#
#   If the fiscal year being requested is 2001-2002
#   then the fiscal year of the date from the YTD Table and the "previous"
#   Estimate will be for fiscal year 2000-2001 (or 30-Jun-2001)
#
if ($REQUEST{INITIAL} eq 'NO') {
    #
    #   converting YYYY(1)-YYYY(2) to 30-Jun-YYYY(2)
    $fy=Internal_FY($REQUEST{FY});
    }
else {
    my $year;
    (undef,undef,undef,undef,undef,$year)=localtime;
    $REQUEST{FY}=sprintf("%4d-%4d",1900 + $year, 1901 + $year);
    $fy=Internal_FY($REQUEST{FY});
    }
$prev_fy='30-Jun-' . substr($REQUEST{FY},0,4);
print center(font({-size=>3},'Fiscal Year'),
    $q->textfield(  -name=>'FY',
                    -default=>"$REQUEST{FY}",
                    -size=>9,
                    -maxlength=>9));
print "\n";
$database=MyConnect();  # returns the database handle !
@setup = MyCategory($database, 1);  #prepare and returns ref to rows,
initial
($sth{CATEGORY}, $category)=@setup;
$CATEGORY=CAT_is($category);    # move results hash
if ($REQUEST{ACCT} ne ''  or $REQUEST{CUST_ID} ne '') {
    #
    #   IF <INITIAL> and/or <ACCT,CUST_ID> requested
    #   then get data for requested Acct or Customer
    #   ELSE ship out "blank form"
    #
    @setup=MyYTD($database, 1, "$prev_fy", $CATEGORY->{NBR},
                    $REQUEST{ACCT}, $REQUEST{CUST_ID});
    #
    #   YTD is by Product so if REQUEST{VIEW} = CATEGORY
    #       then "roll up" YTD
    #
    ($sth{MyYTD},$ytd)=@setup;
    $YTD=YTD_is($ytd);
    @setup=MyEst_by_Cat($database, 1, $CATEGORY->{NBR},
                    "$prev_fy",
                    $REQUEST{ACCT},
                    $REQUEST{CUST_ID});
    ($sth{MyEstimate},$est)=@setup;
$EST=EST_is($est);
    $title=($EST->{TITLE} ne '')?$EST->{TITLE}:$YTD->{TITLE};
    $cust_id=($EST->{CUST_ID} ne '')?$EST->{CUST_ID}:$YTD->{CUST_ID};
    $status='Requested data displayed...';
    }
#print start_table;
print "<table>\n";
my %ids =   (   1 =>{   label   =>'Customer Id',
                        name    =>'CUST_ID',
                        defa    =>$cust_id,
                        size    =>10,},
                2 =>{   label   =>'Account',
                        name    =>'ACCT',
                        defa    =>"$acct",
                        size    =>15,},
                3 =>{   label   =>'Title',
                        name    =>'TITLE',
                        defa    =>"$title",
                        size    =>50,});
foreach (sort keys %ids) {
    print Tr(
            td({-align=>'RIGHT'},$ids{$_}{label},b(':')),
            td({-align=>'LEFT'},
textfield(  -name=>$ids{$_}{name},
                                -default    =>$ids{$_}{defa},
                                -size       =>$ids{$_}{size},
                                -maxlength  =>$ids{$_}{size})),"\n");
}
print "</TABLE>\n";
print center($q->submit({-name=>'Get', -value=>'  Get  '}));
print
p(
    center(
        'View Estimate by:',
        $q->radio_group(-name=>'ACTION', -values=>['ACCOUNT', 'CUSTOMER']),
        hr({width=>'80%'}),
    )
);
print $q->endform, "\n"; ##### offending code maybe ? <== <==
#
#   form for input of estimates, sends confirmation/results of submit
#       to "toolbar" ...
#
print $q->startform({-target=>"toolbar"}),
#
#   build "table" by Category

There is more but the "extra" is being added on the above form ...
But does not appear to be present on other "endform" calls ...

John W Moon

State of Florida
State Technology Office
1255 S Main St.
Georgetown, TX  78626

Email:  [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
Phone: (512) 868-8874

                -----Original Message-----
                From:   Curtis Poe [mailto:[EMAIL PROTECTED]]
                Sent:   June 21, 2001 11:28
                To:     CGI Beginners
                Subject:        RE: Extra <INPUT TYPE="hidden"
NAME=".cgifields" VALUE="ACTION">  ?


                --- "Moon, John" <[EMAIL PROTECTED]> wrote:
                > Yes, I assumed it is trying to help me ...
                > 
                > But don't want it's (CGI's) help ...  in this case 
                > 
                > Any one know how to stop it ... I do a $q->new CGI after
getting my values
                > from the post ;  and yes I use $q->endform; 
                > 
                > 
                > John W Moon

                Um, what exactly do you mean when you say that you do
"$q->new CGI" after getting your values form
                the post?  Is that the syntax that you are using and, if so,
what are you trying to accomplish?

                Again, showing us your code would be a big help.

                Cheers,
                Curtis

                =====
                Senior Programmer
                Onsite! Technology (http://www.onsitetech.com/)
                "Ovid" on http://www.perlmonks.org/

                __________________________________________________
                Do You Yahoo!?
                Get personalized email addresses from Yahoo! Mail
                http://personal.mail.yahoo.com/

Reply via email to