Help create help page on reload
Trying to create a page that when you click a icon it reload the page but adds code to the page, then click it again and it removes the code. Example Click help icon on page, reloads and help screen is inserted, press help icon again and it disappears
You could do this with JavaScript. Maybe like this.
<a href="www.site.com" onClick="javascript :refresh();">
<div style="display:none;" onReload="docment.style.display == 'block';">
Info
</div>
On don't know if onReload is a real event handler, but onLoad is.
Thanks, that might work. But I'm really looking for an answer that dose it in perl and cgi
I don't know those languages yet. Sorry!
That's ok, Maybe someone else will be help. And thanks again.
Code:
#!/usr/local/bin/perl -Tw
use strict;
use CGI ':standard';
print "Content-Type: text/html\n\n";
print q`
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Guestbook</title>
</head>
<body>
`;
if ( param('help') eq 'show' ) {
print '-- HELP SCREEN HERE --<br><a href="script.pl">hide help screen</a>';
}
else {
print '<a href="script.pl?help=show">show help screen</a>';
}
print q`
</body>
</html>
`;
Thanks, I try that.
The script worked, how could you convert it to work with a form and an image button. like this example -
#!/usr/bin/perl
use CGI qw(:standard :netscape);
print header;
print start_html(-title=>'Blank Page',
-stlye=>'rel'=>'stylesheet','type'=>'text/css', 'src'=>'###.css'}
, -class=>'content',
-onLoad=>"if(#######){########('########')}");
print start_form({-method=>'post' ,-action=>'blank.cgi' ,
name=>'help'});
print table({-width=>'100%'},Tr(td({-valign=>'bottom', -align=>'left' ,width=>'50%'},div({-class=>'page-title'},'#### ### ######!')), td({-align=>'center' ,-width=>'50%' ,-colspan=>'3'}),td({-align=>'center' ,-width=>'50%' ,-colspan=>'7'}), image_button({-name=>'Help' ,-src=>'/images/help.gif' ,-align=>'absmiddle' ,-height=>'17' ,-alt=>'Help' ,-border=>'0' ,class=>'button-context' ,-width=>'17'}))
);
print end_form;
print hr;
to this
print header;
print start_html(-title=>'Blank Page',
-stlye=>'rel'=>'stylesheet','type'=>'text/css', 'src'=>'###.css'}
, -class=>'content',
-onLoad=>"if(######){#######('########')}");
print start_form({-method=>'post' ,-action=>'blank.cgi' ,
name=>'help'});
print table({-width=>'100%'}, Tr(td({-valign=>'bottom', -align=>'left' ,width=>'50%'},div({-class=>'page-title'},#### ### ######!')), td({-align=>'center' ,-width=>'50%' ,-colspan=>'3'}),'TEXT IS PLACED HERE',td({-align=>'center' ,-width=>'50%' ,-colspan=>'7'}), image_button({-name=>'Help' ,-src=>'/images/help.gif' ,-align=>'absmiddle' ,-height=>'17' ,-alt=>'Help' ,-border=>'0' ,class=>'button-context' ,-width=>'17'}))
);
print end_form;
print hr;
And yes I do know some perl and cgi, i just don' know how to code that kind of condition in
If you want to do it with a form then just insert it as a hidden field.
Code:
<input type="hidden" name="help" value="show">
The omit this field if param('help') eq 'show' so in that case when the form is submitted there will be no help value passed.
Thanks, Ill give it a try
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks