Hi,
I know this question (or derivatives of it) have been asked before, I found a load in the super search and have tried a couple of the recommendations, but, I always end up coming short. I am 100% positive, there must be something I am missing, but, due to my minimal perl/html/javascript knowledge, I thought I would come to the monestry and seek the wisdom of those who came before....
My setup is as follows:
I have 2 perl scripts,
1 show_page.pl
This script displays a web page and prints a form with 2 "questions" a system name and a message. When the user presses the submit button, a new window opens which "should" run the second script,
2 create_data.pl
This script takes the 2 parameters passed from the above script and converts all text files in a directory to html, displaying output to the new window as it does it (this does not happen though).
Now, the problem I am havin is:
1 When I click on the submit button, the new browser window opens, but my parameters dont appear to have been passed accross to the new script, and, the original window (show_page) executes the 2nd script and displays it in the original window????, an excerpt of my code follows:
1 In show_page.pl
print $front_page -> start_form(-method => 'GET');
print $front_page -> p( $front_page -> code({-align => 'left'}, 'S
+ystem\'s fully qualified name (hostname + domain name) ',
$front_page -> textfield( -name => 'machine
+_name', -size => '40', -default => '', -override => '1' )));
print $front_page -> p( $front_page -> code({-align => 'left'}, 'S
+elect the reason for the creation/updating of runbook: ',
$front_page -> popup_menu(-name => 'rea
+son',
-values => ['Sy
+stem initial build release','System hardware changed',
'Sys
+tem software changed','Daily update for recovery'],
-override => '1',
-default => 'Sys
+tem initial build release')));
print $front_page -> center( $front_page -> submit (-name => 'subm
+it', -label => 'Process',
-target => 'cr
+eate_window',
-onClick => "j
+avascript:window.open('http://xww.test.com/cgi-bin/cgiwrap/root
cgi/create_data.pl','create_window','');void(0)"),
$front_page -> reset ());
If I remove the onclick bit, and add an action section to the start_form method to point to the create_data.pl script, all works fine, so I know the scripts (perl) bits appear to be ok, but when I open the new window, I seem to lose my parameters???
Can anyone please help with this coz I'm starting to lose hair with this, I'm sure I am overlooking something so trivial here, that when someone points it out, I will more than likely kick myself (or someone will kick me).
Could it also possibly be that I am going about this in the wrong way, is there any other possible solution to what I am trying todo here??
Thanks
Your humble servent
Asgaroth