udsrem
11-24-2002, 12:53 AM
I know this code should work but can not figure out why. Get error that something is wrong with the IF statement, I've looked a different programs and the codding looks alright. Could Someone look at this code and show what it would take to get it to work. Thanks
When the image button is pressed it should reload the screen to add a help screen and when the button is pressed again it should reload it again but that time it removes it.
The code:
#!/usr/bin/perl -w
use CGI ':standard';
my $query = new CGI;
print $query->header;
print "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>";
print $query->start_html(-title=>'Blank Page',-author=>'##########', -expires=>'now',
-style=>{'rel'=>'stylesheet','type'=>'text/css', 'src'=>'webley.css'}, -class=>'content',
-onLoad=>"if(######){######('#######')}");
print $query->start_form({-method=>'post' ,-action=>'blank.cgi' ,name=>'help'});
print $query->table({-width=>'100%'},
print $query->Tr(td({-valign=>'bottom', -align=>'left' ,width=>'50%'},div({-class=>'page-title'},'### ##### ########')),
if ($query->param('Help.x')) {
print td({-align=>'center' ,-width=>'50%' ,-colspan=>'3',-class=>'page-title'}),'Did it Work',td({-align=>'center' ,-width=>'50%' ,-colspan=>'7'});
print image_button({-name=>'Help_content' ,-src=>'/images/context_help.gif' ,-align=>'absmiddle' ,-height=>'17' ,-alt=>'Help' ,-border=>'0' ,class=>'button-context' ,-width=>'17'}))
}
else {
print td({-align=>'center' ,-width=>'50%' ,-colspan=>'3' }),td({-align=>'center' ,-width=>'50%' ,-colspan=>'7'});
print image_button({-name=>'Help' ,-src=>'/images/context_help.gif' ,-align=>'absmiddle' ,-height=>'17' ,-alt=>'Help' ,-border=>'0' ,class=>'button-context' ,-width=>'17'}))
},
);
print "</FORM>";
print "<hr />";
print $query->end_html;
When the image button is pressed it should reload the screen to add a help screen and when the button is pressed again it should reload it again but that time it removes it.
The code:
#!/usr/bin/perl -w
use CGI ':standard';
my $query = new CGI;
print $query->header;
print "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>";
print $query->start_html(-title=>'Blank Page',-author=>'##########', -expires=>'now',
-style=>{'rel'=>'stylesheet','type'=>'text/css', 'src'=>'webley.css'}, -class=>'content',
-onLoad=>"if(######){######('#######')}");
print $query->start_form({-method=>'post' ,-action=>'blank.cgi' ,name=>'help'});
print $query->table({-width=>'100%'},
print $query->Tr(td({-valign=>'bottom', -align=>'left' ,width=>'50%'},div({-class=>'page-title'},'### ##### ########')),
if ($query->param('Help.x')) {
print td({-align=>'center' ,-width=>'50%' ,-colspan=>'3',-class=>'page-title'}),'Did it Work',td({-align=>'center' ,-width=>'50%' ,-colspan=>'7'});
print image_button({-name=>'Help_content' ,-src=>'/images/context_help.gif' ,-align=>'absmiddle' ,-height=>'17' ,-alt=>'Help' ,-border=>'0' ,class=>'button-context' ,-width=>'17'}))
}
else {
print td({-align=>'center' ,-width=>'50%' ,-colspan=>'3' }),td({-align=>'center' ,-width=>'50%' ,-colspan=>'7'});
print image_button({-name=>'Help' ,-src=>'/images/context_help.gif' ,-align=>'absmiddle' ,-height=>'17' ,-alt=>'Help' ,-border=>'0' ,class=>'button-context' ,-width=>'17'}))
},
);
print "</FORM>";
print "<hr />";
print $query->end_html;