Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Back Button with Perl Script  (Read 5008 times)

0 Members and 1 Guest are viewing this topic.

iangreenfield

  • Guest
Back Button with Perl Script
« on: March 09, 2007, 02:39:28 AM »
I am trying to create a back button within a simple perl script.

print "<input type="button" value="Back" onclick="goBack()" />";

doesn't work. Please can some one help?

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: Back Button with Perl Script
« Reply #1 on: March 12, 2007, 02:38:41 PM »
Have you made any attempt to write the javascript function, "goBack()"?
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

iangreenfield

  • Guest
Re: Back Button with Perl Script
« Reply #2 on: March 12, 2007, 03:19:21 PM »
No, I have never used java script. My limit has been CGI & Perl by Mike McGrath. Sorry

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: Back Button with Perl Script
« Reply #3 on: March 13, 2007, 05:47:52 AM »
Okay, well you are definitely trying to call a javascript (or VBScript) function there.  I think you mean

Code: [Select]
<input type="button" value="Back" onclick="history.back()" />but please read >this article< and have a think about whether you really want to do this.  I've never seen the benefit, personally.
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

iangreenfield

  • Guest
Re: Back Button with Perl Script
« Reply #4 on: March 13, 2007, 06:12:40 AM »
Thank you. I have managed to make the back link work, but not the button.

print"<center><a href=\"javascript:history.back(1)\">Back[/url]</center>";

I intend using this when picking up errors while validating entries on a 'Contact us' imput form. Thanks for your patience. I am a rank outsider and help is really appreciated. While not complete the contact form can be seen at www.gradedseconds.co.uk

Thank you again

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: Back Button with Perl Script
« Reply #5 on: March 13, 2007, 07:40:50 AM »
If you can point me to a page with the non-functioning back button on it, I'll debug it for you.
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

iangreenfield

  • Guest
Re: Back Button with Perl Script
« Reply #6 on: March 13, 2007, 07:59:22 AM »
The non functioning back button is in a perl CGI script which is called from a form. I have tried a pair of \'s with the code and was only able to get the link to work (not the button)

The page with the form now works, checking if there is input on each required box.

The page with the Contact form may be found at

http://millie.pobox.co.uk/html/contactuso.html

I can email the script if you can tell me how.

(I must admit that for a beginner, I am quite pleased with the result so far. But like all things there is always room for improvement!)

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: Back Button with Perl Script
« Reply #7 on: March 13, 2007, 08:13:58 AM »
You could perhaps post the perl script that should create the button.  Of course this would not work:

Code: [Select]
print "<input type="button" value="Back" onclick="javascript:history.back(1);" />";but this should:

Code: [Select]
print "<input type='button' value='Back' onclick='javascript:history.back(1);' />";
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

iangreenfield

  • Guest
Re: Back Button with Perl Script
« Reply #8 on: March 13, 2007, 11:18:34 AM »
So near, but so far. Thank you for your help, it works now.

Regards Ian  

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: Back Button with Perl Script
« Reply #9 on: March 13, 2007, 03:17:43 PM »
No problem!
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos