/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment

9 Comments(s)

Copy linkTweet thisAlerts:
@Zach_ElfersNov 22.2002 — 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.?
Copy linkTweet thisAlerts:
@udsremauthorNov 22.2002 — Thanks, that might work. But I'm really looking for an answer that dose it in perl and cgi
Copy linkTweet thisAlerts:
@Zach_ElfersNov 22.2002 — I don't know those languages yet. Sorry!?
Copy linkTweet thisAlerts:
@udsremauthorNov 22.2002 — That's ok, Maybe someone else will be help. And thanks again.
Copy linkTweet thisAlerts:
@jeffmottNov 22.2002 — #!/usr/local/bin/perl -Tw

use strict;
use CGI ':standard';

print "Content-Type: text/htmlnn";

print q<span><code>
&amp;lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
&quot;http://www.w3.org/TR/html4/strict.dtd&quot;&amp;gt;

&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&amp;gt;
&amp;lt;title&amp;gt;Guestbook&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
</code></span>;

if ( param('help') eq 'show' ) {
print '-- HELP SCREEN HERE --&lt;br&gt;&lt;a href="script.pl"&gt;hide help screen&lt;/a&gt;';
}
else {
print '&lt;a href="script.pl?help=show"&gt;show help screen&lt;/a&gt;';
}

print q<span><code>
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
</code></span>;
Copy linkTweet thisAlerts:
@udsremauthorNov 22.2002 — Thanks, I try that. ?
Copy linkTweet thisAlerts:
@udsremauthorNov 22.2002 — 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
Copy linkTweet thisAlerts:
@jeffmottNov 22.2002 — If you want to do it with a form then just insert it as a hidden field.

&lt;input type="hidden" name="help" value="show"&gt;

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.
Copy linkTweet thisAlerts:
@udsremauthorNov 23.2002 — Thanks, Ill give it a try?
×

Success!

Help @udsrem spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...