in reply to Re^3: how to make dependent drop down in perl script (missing header)
in thread how to make dependent drop down in perl script

If your data is HTML then obviously print an HTML Content Type rather than a plain text one.

print "Content-type: text/html\n\n";

Your post is was confusing. Please enclose your output inside <code> tags so that we can tell what it really is.

Updated - thanks Corion for editing the parent to add the code tags.


🦛

Replies are listed 'Best First'.
Re^5: how to make dependent drop down in perl script (missing header)
by Anonymous Monk on May 01, 2023 at 15:11 UTC

    Please find the below related code that short the drop down value. In this , I want to Set 'None' as selected in dropdown when page get load initially,

    my %folderMapFinal; #print $q->header; print "Content-type: text/plain\n\n"; print "Content-type: text/html\n\n"; foreach my $folderMap (sort keys %folderhash) { print STDERR "INSIDE FOR LOOP FOR FOLDERMAP\n"; %folderMapFinal =$folderMap; printf "%-8s %s\n\n", $folderMap, $folderhash{$folderMap}; } $q->div( { -class => "text" }, "Folder Name* : ", #my $defaultVal ='0', $q->popup_menu( -name=>'foldernameval', -id=> 'folder_name_id', -onChange => 'getReportName()', -type=>'dropdown', #-values=> \%folderhash, -values=> \%folderMapFinal, #-default=>$defaultVal, -default=>['0'], ), $q->hidden( -name => ('folder_name', -id=> 'h_folder_name_id', -va +lue => '' )), #$q->a( { -href => "signoff.cgi?rm=view_report&fId=3", -onClick => + 'setFolderNameId()', -title => "Populate Report Name" }, "Populate +Report Name" ), ),$q->end_div, $q->br, $q->br, $q->div( { -class => "text" }, "Report Name* : ", $q->popup_menu( -name=>'reportnameval', -id=> 'report_name_id', -onchange => 'setReportId()', -type=>'dropdown', -values=> \%reportHash, -default=>['0'], ), $q->hidden( -name => ('report_name', -id=> 'h_report_name_id', -va +lue => '' )), #$q->a( { -href => " ", -onClick => 'setFolderNameIdInURL()', -ti +tle => "Populate Report Name" }, " Click here to Populate Report Name +" ),
Re^5: how to make dependent drop down in perl script (missing header)
by Anonymous Monk on May 01, 2023 at 14:20 UTC
    Please find the below code :
    my %folderMapFinal; #print $q->header; #print "Content-type: text/plain\n\n"; print "Content-type: text/html\n\n"; foreach my $folderMap (sort keys %folderhash) { %folderMapFinal =$folderMap; printf "%-8s %s\n\n", $folderMap, $folderhash{$folderMap}; } $q->div( { -class => "text" }, "Folder Name* : ", #my $defaultVal ='0', $q->popup_menu( -name=>'foldernameval', -id=> 'folder_name_id', -onChange => 'getReportName()', -type=>'dropdown', #-values=> \%folderhash, -values=> \%folderMapFinal, #-default=>$defaultVal, -default=>['0'], ), $q->hidden( -name => ('folder_name', -id=> 'h_folder_name_id', -va +lue => '' )), #$q->a( { -href => "signoff.cgi?rm=view_report&fId=3", -onClick => + 'setFolderNameId()', -title => "Populate Report Name" }, "Populate +Report Name" ), ),$q->end_div, $q->br, $q->br, $q->div( { -class => "text" }, "Report Name* : ", $q->popup_menu( -name=>'reportnameval', -id=> 'report_name_id', -onchange => 'setReportId()', -type=>'dropdown', -values=> \%reportHash, -default=>['0'], ), $q->hidden( -name => ('report_name', -id=> 'h_report_name_id', -va +lue => '' )), #$q->a( { -href => " ", -onClick => 'setFolderNameIdInURL()', -ti +tle => "Populate Report Name" }, " Click here to Populate Report Name +" ), ),$q->end_div,

      Not an SSCCE, no output shown, as requested a couple of times already.

        Sorry, Now showing the output in below :

        [Mon May 1 09:23:22 2023] signoff.cgi: BEGIN failed--compilation abor +ted at /v/region/na/appl/msim/imasg_env/data/imasgdev/bin/notify/sign +OffPageOnDev/cgi/signoff.cgi line 22, <DATA> line 275. [Mon May 1 09:23:30 2023] signoff.cgi: Global symbol "%folderMapFinal +" requires explicit package name at ..//signoff.pm line 695, <DATA> l +ine 275. [Mon May 1 09:23:30 2023] signoff.cgi: Global symbol "%folderMapFinal +" requires explicit package name at ..//signoff.pm line 707, <DATA> l +ine 275. [Mon May 1 09:23:30 2023] signoff.cgi: Compilation failed in require +at /v/region/na/appl/msim/imasg_env/data/imasgdev/bin/notify/signOffP +ageOnDev/cgi/signoff.cgi line 22, <DATA> line 275. [Mon May 1 09:23:30 2023] signoff.cgi: BEGIN failed--compilation abor +ted at /v/region/na/appl/msim/imasg_env/data/imasgdev/bin/notify/sign +OffPageOnDev/cgi/signoff.cgi line 22, <DATA> line 275. FROM DATE : AND ToDate : FLAG VLAUE IS : AND FID VLAUE IS : 0 TO DATE from Hidden ******* : AND TO DATE from Hidden*********: TO DATE form URL ******* : AND TO DATE from URL *********: **IF BLOCK----------FOLDER ID IS BLANK : META GROUP COUNT IS : AND META GROUP IS : FROM DATE : AND ToDate : FLAG VLAUE IS : AND FID VLAUE IS : 0 TO DATE from Hidden ******* : AND TO DATE from Hidden*********: TO DATE form URL ******* : AND TO DATE from URL *********: **IF BLOCK----------FOLDER ID IS BLANK : META GROUP COUNT IS : AND META GROUP IS : FROM DATE : AND ToDate : FLAG VLAUE IS : AND FID VLAUE IS : 0 TO DATE from Hidden ******* : AND TO DATE from Hidden*********: TO DATE form URL ******* : AND TO DATE from URL *********: **IF BLOCK----------FOLDER ID IS BLANK : META GROUP COUNT IS : AND META GROUP IS : FROM DATE : AND ToDate : FLAG VLAUE IS : AND FID VLAUE IS : 0 TO DATE from Hidden ******* : AND TO DATE from Hidden*********: TO DATE form URL ******* : AND TO DATE from URL *********: **IF BLOCK----------FOLDER ID IS BLANK : INSIDE FOR LOOP FOR FOLDERMAP INSIDE FOR LOOP FOR FOLDERMAP INSIDE FOR LOOP FOR FOLDERMAP INSIDE FOR LOOP FOR FOLDERMAP INSIDE FOR LOOP FOR FOLDERMAP INSIDE FOR LOOP FOR FOLDERMAP META GROUP COUNT IS : AND META GROUP IS : FROM DATE : AND ToDate : FLAG VLAUE IS : AND FID VLAUE IS : 0 TO DATE from Hidden ******* : AND TO DATE from Hidden*********: TO DATE form URL ******* : AND TO DATE from URL *********: