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

In reply to How to pass form data to a onclick=javascript:new.window perl script by Asgaroth

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.