[23075] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5296 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 31 06:05:46 2003

Date: Thu, 31 Jul 2003 03:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 31 Jul 2003     Volume: 10 Number: 5296

Today's topics:
        <input type='image'>  ...  IE fails to pass value while (John Everett)
    Re: <input type='image'>  ...  IE fails to pass value w <NOSPAM@bigpond.com>
    Re: <input type='image'>  ...  IE fails to pass value w <mbudash@sonic.net>
    Re: <input type='image'>  ...  IE fails to pass value w <REMOVEsdnCAPS@comcast.net>
    Re: <input type='image'>  ...  IE fails to pass value w <flavell@mail.cern.ch>
    Re: Anyone build the Berkeley DBXML library for AS and  <kalinabears@iinet.net.au>
        error validation question (Julia Briggs)
    Re: error validation question <NOSPAM@bigpond.com>
    Re: error validation question <web_developer@poczta.fm>
    Re: error validation question <REMOVEsdnCAPS@comcast.net>
    Re: failed /g match on empty string does not reset pos( <dbo@xbn.nl>
    Re: Gnuplot module (Alythh)
        parsing large (>1gb) strings..how? (Patrick Cotner)
    Re: Perl Objects <zen13097@zen.co.uk>
    Re: removing some text (Tony W)
    Re: Sorting out sort (Peter Stokes)
    Re: split alternative using regexp? <g4rry_sh0rt@zw4llet.com>
        suggest a module for sar <john.thetenant-s@moving-picture.com>
        using post method (hash)
    Re: using post method <NOSPAM@bigpond.com>
    Re: Web page with frames... <dhbrown@hobbes.dhbrown.net>
    Re: Web page with frames... <mgarrish@rogers.com>
    Re: Web page with frames... <none@given.com>
    Re: Web page with frames... <jurgenex@hotmail.com>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 30 Jul 2003 22:04:30 -0700
From: john_k_everett@hotmail.com (John Everett)
Subject: <input type='image'>  ...  IE fails to pass value while Mozilla and Netsacpe works
Message-Id: <e3da9316.0307302104.73723639@posting.google.com>

newsgroup...

I have found that the <input type=image'> passes a value when
interpeted with Netscape or Mozilla but NOT with IE.

Consider the following:

HTML page passing a form...

<html>
<head>
</head>
<body>
<form name='test' action='test.cgi' method='post'>
 <input type='image' name='test' value='1' src='../images/blue_bullet.jpg'>
</from>
</body>
</html>



Perl cgi script catching the form (test.cgi)...

#!/usr/bin/perl
use CGI;

my $page = new CGI;
my $test_value = $page -> param('test');
print $page -> header();
print "test value: $test_value <br>";


Both Netscape and Mozilla and print $test_value
as "1" while IE prints it as an empty string.

Why does the HTML page not pass the input value
to the cgi script?

Any help would be great!

Thanks in advance.
   John


------------------------------

Date: Thu, 31 Jul 2003 15:15:37 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: <input type='image'>  ...  IE fails to pass value while Mozilla and Netsacpe works
Message-Id: <bga8l5$m2a07$1@ID-202028.news.uni-berlin.de>

"John Everett" <john_k_everett@hotmail.com> wrote in message
news:e3da9316.0307302104.73723639@posting.google.com...
> newsgroup...
>
> I have found that the <input type=image'> passes a value when
> interpeted with Netscape or Mozilla but NOT with IE.

Good lord! Is this a Perl newsgroup of a HTML/IE/Netscape newsgroup?

>
> Both Netscape and Mozilla and print $test_value
> as "1" while IE prints it as an empty string.
>
> Why does the HTML page not pass the input value
> to the cgi script?
>
Ask Bill Gates???

gtoomey




------------------------------

Date: Thu, 31 Jul 2003 05:15:52 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: <input type='image'>  ...  IE fails to pass value while Mozilla and Netsacpe works
Message-Id: <mbudash-AC1385.22155230072003@typhoon.sonic.net>

In article <e3da9316.0307302104.73723639@posting.google.com>,
 john_k_everett@hotmail.com (John Everett) wrote:

> newsgroup...
> 
> I have found that the <input type=image'> passes a value when
> interpeted with Netscape or Mozilla but NOT with IE.
> 
> Consider the following:
> 
> HTML page passing a form...
> 
> <html>
> <head>
> </head>
> <body>
> <form name='test' action='test.cgi' method='post'>
>  <input type='image' name='test' value='1' src='../images/blue_bullet.jpg'>
> </from>
> </body>
> </html>
> 
> Perl cgi script catching the form (test.cgi)...
> 
> #!/usr/bin/perl
> use CGI;
> 
> my $page = new CGI;
> my $test_value = $page -> param('test');
> print $page -> header();
> print "test value: $test_value <br>";
> 
> 
> Both Netscape and Mozilla and print $test_value
> as "1" while IE prints it as an empty string.
> 
> Why does the HTML page not pass the input value
> to the cgi script?

per http://www.htmlhelp.com/reference/html40/forms/input.html:

"When the graphical submit button is clicked, the coordinates of the 
click are sent with the form submission as name.x=x-value and 
name.y=y-value where name is the value of the NAME attribute, x-value is 
the click's pixels from the left of the image, and y-value is the 
click's pixels from the top of the image..."

looks like Netscape and Mozilla have (at least) extended the proper 
behaviour... try your test with param('text.x') and see qhat happens...

hth-
-- 
Michael Budash


------------------------------

Date: Thu, 31 Jul 2003 05:01:25 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: <input type='image'>  ...  IE fails to pass value while Mozilla and Netsacpe works
Message-Id: <Xns93C93D2A63AA6sdn.comcast@206.127.4.25>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

john_k_everett@hotmail.com (John Everett) wrote in
news:e3da9316.0307302104.73723639@posting.google.com: 

> use CGI;
> 
> my $page = new CGI;
> my $test_value = $page -> param('test');
> print $page -> header();
> print "test value: $test_value <br>";
> 
> 
> Both Netscape and Mozilla and print $test_value
> as "1" while IE prints it as an empty string.
> 
> Why does the HTML page not pass the input value
> to the cgi script?

Looks like both Mozilla and Netscape are doing the wrong thing, while IE is 
adhering to the standards.  Wonders never cease.

Your question has nothing to do with Perl.  Questions like this should be 
posted to a newsgroup related to html, like comp.infosystems.www.html.

Check for the 'test.x' or 'test.y' parameter, not 'test'.

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPyjozGPeouIeTNHoEQIpfwCgoqPcXOPz9Fqz/aPSX3UFeU9QohkAoLSl
civQymX8zgPoMhmgCskY3zp+
=wKx6
-----END PGP SIGNATURE-----


------------------------------

Date: Thu, 31 Jul 2003 11:25:59 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: <input type='image'>  ...  IE fails to pass value while Mozilla and Netsacpe works
Message-Id: <Pine.LNX.4.53.0307311125130.15011@lxplus002.cern.ch>

On Thu, Jul 30, John Everett inscribed on the eternal scroll:

> I have found that the <input type=image'> passes a value when
> interpeted with Netscape or Mozilla but NOT with IE.

Already answered in another of the places where you posted the same
question.

READ the goddamned posting guidelines!


------------------------------

Date: Thu, 31 Jul 2003 14:19:24 +1000
From: "Sisyphus" <kalinabears@iinet.net.au>
Subject: Re: Anyone build the Berkeley DBXML library for AS and Windows?
Message-Id: <3f2899db$0$23584$5a62ac22@freenews.iinet.net.au>


"Bob" <bobx@linuxmail.org> wrote in message

>
> I have the binary for Windows but not the Perl stuff needed.
>

Has the "Perl stuff needed" been written yet ?
If so, tell us which specific module you want, and someone might be able to
help.

(I'm not being a smartarse ..... I really don't know if it's just a matter
of building an existing module for you .... or if the problem is that the
module you would need has not yet been written.)

Cheers,
Rob




------------------------------

Date: 31 Jul 2003 01:02:22 -0700
From: julia4_me@yahoo.com (Julia Briggs)
Subject: error validation question
Message-Id: <c48f65ef.0307310002.7bdc598e@posting.google.com>

What is the cleanest and easiest way to produce on screen (no-popup)
error validations for forms?

Sincerely,

%Julia%


------------------------------

Date: Thu, 31 Jul 2003 18:21:39 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: error validation question
Message-Id: <bgajhm$mj0jl$1@ID-202028.news.uni-berlin.de>

"Julia Briggs" <julia4_me@yahoo.com> wrote in message
news:c48f65ef.0307310002.7bdc598e@posting.google.com...
> What is the cleanest and easiest way to produce on screen (no-popup)
> error validations for forms?
>
> Sincerely,
>
> %Julia%

Does anybody have a recipe for lamb shanks - we are in a cold snap here in
Australia?

(Since you did not ask a Perl question I presume this group has become a
free-for-all.)

gtoomey




------------------------------

Date: Thu, 31 Jul 2003 10:28:51 +0200
From: web <web_developer@poczta.fm>
Subject: Re: error validation question
Message-Id: <MPG.1992f1ae51f97f64989690@news.tpi.pl>

In article <c48f65ef.0307310002.7bdc598e@posting.google.com>, julia4
_me@yahoo.com says...

> What is the cleanest and easiest way to produce on screen (no-popup)
> error validations for forms?

Hi, Julia,

I think the best way is to show the form once again with the data that 
the user filled in, print an error message above the form and 
additionally mark the fields that contain the incorrect values. It's not 
an easiest way but it's the best one in my opinion. The user will see 
the error message and will be able to correct the data in the form.


------------------------------

Date: Thu, 31 Jul 2003 05:04:01 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: error validation question
Message-Id: <Xns93C93D9B76166sdn.comcast@206.127.4.25>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

julia4_me@yahoo.com (Julia Briggs) wrote in 
news:c48f65ef.0307310002.7bdc598e@posting.google.com:

> What is the cleanest and easiest way to produce on screen (no-popup)
> error validations for forms?

Criminy!  This is the fourth HTML-only question asked in this supposedly 
perl-oriented newsgroup in the past 12 hours!

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPyjpaGPeouIeTNHoEQIVCQCfYZLx/x27gWawMYw8PjrbMBIZp7IAnjZ/
gmsDlPiQGCRMjtL80aCXkGLV
=2wx4
-----END PGP SIGNATURE-----


------------------------------

Date: Thu, 31 Jul 2003 10:46:13 +0200
From: David Bouman <dbo@xbn.nl>
Subject: Re: failed /g match on empty string does not reset pos()
Message-Id: <3F28D755.49201E89@xbn.nl>

Steve Grazzini wrote:
> David Bouman <dbo@xbn.nl> wrote:
>> Steve Grazzini wrote:
>>
>>> More generally, it looks like the "target is too short"
>>> optimization isn't resetting pos().
>> Ok so it *is* a bug then. Has somebody filed a report yet?
> I was going to leave that honor to you. :-)

Thanks, there's one on its way now. But since I felt I couldn't take
credit for identifying the real cause of the error I attributed that
fact to you, hope that's ok.

> By the way, you can browse/search the bug database:
>
> http://xrl.us/npd  [ a search for "pos(" ]
>
> I couldn't find anything directly related.

well, now you can :)

--
David.


------------------------------

Date: 31 Jul 2003 01:32:35 -0700
From: alythh@netscape.net (Alythh)
Subject: Re: Gnuplot module
Message-Id: <6a25ba72.0307310032.6bfa0d72@posting.google.com>

actually, I came up with an elaborate way to do it, not
straightforward but it works:
download and install the program "camwatch", then, before using
gnuplot() to save the image to $picsave:

$status=system("camwatch -u file://$picsave -d 1 -t temp.pbm&");

 ... wish there was some perlish way to do it!

Alessandro

yuchung@mail.com (Yuchung Cheng) wrote in message news:<c5a86edd.0307272230.4c41d129@posting.google.com>...
> alythh@netscape.net (Alythh) wrote in message news:<6a25ba72.0307230050.57da7475@posting.google.com>...
> > I just installed  Chart::Graph::Gnuplot, and I'm fairly satisfied.
> > But...
> > 
> > My wish is to be able to make a  gnuplot() call, make it display the
> > graph, and stay there while other data becomes available... while
> > replotting the updated data.
> > 
> > Is there a way to communicate between the two processes in this way?
> > Or is this module just to output to a file?
> > 
> AFAIK, gnuplot only parse static data and generate the graph, even with
> "gnuplot -persist" command. The simplist way to do above is to call 
> gnuplot every once while and re-plot to the same file. 
> 
> -yuchung


------------------------------

Date: 31 Jul 2003 01:45:21 -0700
From: eternaluxe@comcast.net (Patrick Cotner)
Subject: parsing large (>1gb) strings..how?
Message-Id: <8c2d9e34.0307310045.1ffbe498@posting.google.com>

I've written a short perl script which scan an accidentally (or
stupidly) initialised harddrive for lost files.  Here is the code i
have thus far (note that the drive I'm scanning is *not* the drive I
intend to parse once the program is complete...it's just for testing):

# 	This program is *not* finished.  All it does now is read lines from
the
#	HD and prints them to the terminal window.


use warnings;
use strict;

open (DRIVE, "/dev/disk1s9") || die "Whoops! $!";

while (<DRIVE>) {
	print $_;	

}
#    End of program


Ok, it's not much anything.  I'll figure the rest out on my own
(hopefully), but what I need for now is a way to span large (and
mostly empty) chunks of HD that don't contain \n.  Is there a way to
skip to the next line in a file if the first x characters of the
current line don't contain what I'm looking for without reading the
entire string (which can be >1gb at times)?

Any help would be appreciated.  I just need to be pointed in the right
direction.

Thanks,  
Patrick


------------------------------

Date: 31 Jul 2003 07:18:00 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: Perl Objects
Message-Id: <slrnbihj0l.i7l.zen13097@wormhole.homelinux.org>

On 30 Jul 2003 10:21:01 -0700, Paul <elegans@lycos.com> wrote:
>  
>  sub parseTIGRFILE {
>      my $self = shift;
>       ......
>      $parser = new XML::Parser(Handlers => { Start => \&handle_start,
>                                              End   => \&handle_end,
>                                              Char  => \&handle_char,
>  					   } );
>       ......
>  }
>  
>  sub handle_start {
>      my ($expat, $elem, @atvals)= @_;
>      ......
>  }
>  
>  Here is the problem... the handlers cannot not take arguments (unless
>  I am wrong about this... ???), so I cannot pass $self to the handler. 
>  While the data is being parsed, I want it stored in the object's
>  instance variables $self->{MY_VAR}, but the handler doesn't have any
>  way to *see* $self.
>  

Use closures:

[untested]

      $parser = new XML::Parser(Handlers => {
			Start => sub { $self->handle_start( @_ ) },
			End   => sub { $self->handle_end  ( @_ ) },
			Char  => sub { $self->handle_char ( @_ ) },
		    } );
  ...

  sub handle_start {
      my ($self, $expat, $elem, @atvals) = @_;
      ...
  }

-- 
Dave


------------------------------

Date: 31 Jul 2003 02:25:01 -0700
From: tonyw@shelter.org.uk (Tony W)
Subject: Re: removing some text
Message-Id: <f810cf78.0307310125.1cd5d0ed@posting.google.com>

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbig4bm.7vr.tadmc@magna.augustmail.com>...
> Tony W <tonyw@shelter.org.uk> wrote:
> 
> > The line below removes all web links but leaves the text in the file.
> 
> 
> > # Remove existing glossary links
> > $newbody =~ s/<A HREF=\"Javascript\:popup\('[0-9]+',[^>]*>([^<]*)<\/A>/$1/ig;
>                         ^           ^                      
>                         ^           ^                      
> 
> Neither of those backslashes are needed, making the experience
> level of whoever wrote this code questionable...
> 
> 
> > eg. Starts with this:
> ><a href="JavaScript:popup('104',380,460);" class="results">rent in
> > advance</a>
> 
> 
> > I know that all current links
> > are in the format that I've shown in the example above.
> 
> 
> That is a profoundly important caveat.
> 
> It is the one that lets you ignore the usual response to your
> "remove HTML" FAQ.
> 
> 
> > I want a line that will remove any a href link, except for the term
> > (eg landlords - as below)
> > 
> ><a href="/privrent/landlordresps-360-Een-f0.cfm"
>           ^^^^^
>           ^^^^^ where is the "Javascript:popup" part?
> 
> > class="results">Landlords</a>
> 
> 
> So, you want to remove all <a> tags for <a> tags formated as in that
> first one, and you don't care if it is easily broken by legal HTML?
> 
> With all of that out of the way, then you might try doing
> it with a regex.
> 
> But your problem specification is wrong somewhere, the pattern above
> should *already* be leaving that Landlords one alone, it does not
> have "JavaScript" in it...
> 
> 
> ---------------------------------------------
> #!/usr/bin/perl
> use strict;
> use warnings;
> 
> $_ = q(
> <a href="JavaScript:popup('104',380,460);" class="results">rent in advance</a>
> <a href="JavaScript:popup('104',380,460);" class="results">Landlords</a>
> <a href="JavaScript:popup('104',380,460);" class="results">rent in advance</a>
> );
> 
> 
> s/(<A HREF="Javascript:popup\('[0-9]+',[^>]*>([^<]*)<\/A>)/
>   $2 eq 'Landlords' ? $1 : $2
>  /ige;
> 
> print;
> ---------------------------------------------

Apologies. I think I might have not explained it properly.

The perl script is part of a process that nightly removes old html
links and then adds new ones.  The current links are in the format:

<a href="JavaScript:popup('104',380,460);" class="results">rent in
advance</a>

this is used to run a javascript function that opens a small window
showing a glossary definition of the term 'rent in advance'. But now
it is required to work differently. Now it is just going to be a
straightforward link to another page such as:

<a href="/privrent/landlord-360-Een-f0.cfm"
class="results">Landlords</a>
<a href="/homeless/index-1292-Een-f0.cfm" class="results">tenure</a>

There will be no javascript:popup text.  Therefore what I require is
some code to get rid of the html anchor, for example, change:

<a href="/privrent/landlordresps-360-Een-f0.cfm"
class="results">Landlords</a>

to:

Landlords

----
thanks


------------------------------

Date: 31 Jul 2003 01:18:24 -0700
From: peterstokes@operamail.com (Peter Stokes)
Subject: Re: Sorting out sort
Message-Id: <10876b94.0307310018.5c435d82@posting.google.com>

Many thanks for all your help - Tad, the explanation makes complete
sense, now I see where I was taking the wrong approach. JR, your
solution worked a treat, straight out of the box.

regards and best wishes

peter stokes


------------------------------

Date: Thu, 31 Jul 2003 10:38:42 +0000
From: Garry Short <g4rry_sh0rt@zw4llet.com>
Subject: Re: split alternative using regexp?
Message-Id: <bgaobu$cp4$1$8300dec7@news.demon.co.uk>

Greg wrote:

>> #!/usr/bin/perl
>> 
>> use strict;
>> use warnings;
>> 
>> my ($string, @array);
>> 
>> $string = "This is a looong sentence ";
>> @array = ( $string =~ m/\w+/g ) ;
>> 
>> print join ( "\n", @array );
> 
> Sweet thanks guys. That was exactly what I was looking for. Now I am
> trying to join the sentences back together using regexps. Is there any
> way to do this (possibly using the ($'))?
> 
> Thanks again,
> 
> -Greg

Well one way would be:

      1 my @a = qw(this is a long sentence);
      2 foreach my $elem (@a) {
      3   $string =~ s/(. )$/ $elem/;
      4 }
      5 print "$string\n";

But this'll insert a leading space. To get round that, you might have to
resort to this:

      1 my @a = qw(this is a long sentence);
      2 foreach my $elem (@a) {
      3   if ($string) {
      4     $string =~ s/$/ $elem/;
      5   } else {
      6     $string = $elem;
      7   }
      8 }
      9 print "$string\n";

There are probably neater solutions, but you get the idea ...

Garry


P.S. These are both tested AND working! :-)


------------------------------

Date: Thu, 31 Jul 2003 09:24:15 +0100
From: John Strauss <john.thetenant-s@moving-picture.com>
Subject: suggest a module for sar
Message-Id: <20030731092415.6c263e84.john.thetenant-s@moving-picture.com>

i need to create graphs of sar stats for a collection
of servers.  all the servers are running redhat 7.2

can anyone suggest a module for the sar stats, or 
even better, one that creates the graphs as well?

i poked around cpan, and came up with StatsView::Graph::Sar
for Solaris...



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drop the .thetenant to get me via mail


------------------------------

Date: 30 Jul 2003 21:05:22 -0700
From: hash_q@yahoo.com (hash)
Subject: using post method
Message-Id: <634c3c13.0307302005.4c42c0d6@posting.google.com>

Hello All,
I am trying to use the post method in perl to fill a form. The form
is actually for sending an instant message to a cell phone, i
would like to do this automatically without going to the site.
I read the source file for the web page and extracted the text field
names, area=area code, num1=first 3 digit, num2=4 digit, text=the text
to send, but my phone doesn't get the message. Has anyone done this
before and can all forms that are fillable in a web page can be filled
using post method? 

thanks in advance for your help, the script i am using is given below.

web site
---------
http://www.rogers.com/english/wireless/sendpcs.html

script
-------
use LWP::UserAgent;
$ua = LWP::UserAgent->new;

my $req = HTTP::Request->new(POST =>
'http://216.129.53.44:8080/cgi-bin/send_sm_rogers.new');
$req->content_type('application/x-www-form-urlencoded');
$req->content('area=xxx&num1=xxx&num2=xxxx&text=xx');

my $res = $ua->request($req);
print $res->as_string;

exit;


------------------------------

Date: Thu, 31 Jul 2003 15:10:50 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: using post method
Message-Id: <bga8c7$m1h5p$1@ID-202028.news.uni-berlin.de>

"hash" <hash_q@yahoo.com> wrote in message
news:634c3c13.0307302005.4c42c0d6@posting.google.com...
> Hello All,
> I am trying to use the post method in perl to fill a form. The form
> is actually for sending an instant message to a cell phone, i
> would like to do this automatically without going to the site.
> I read the source file for the web page and extracted the text field
> names, area=area code, num1=first 3 digit, num2=4 digit, text=the text
> to send, but my phone doesn't get the message. Has anyone done this
> before and can all forms that are fillable in a web page can be filled
> using post method?
>
> thanks in advance for your help, the script i am using is given below.

Are you saying this works or does not? Have you tried?

Using the KISS principle I would try:

#!/usr/bin/perl
use LWP::Simple;

getprint('http://216.129.53.44:8080/cgi-bin/send_sm_rogers.new?area=xxx&num1
=xxx&num2=xxxx&text=xx');

gtoomey




------------------------------

Date: Thu, 31 Jul 2003 04:23:06 GMT
From: Dave Brown <dhbrown@hobbes.dhbrown.net>
Subject: Re: Web page with frames...
Message-Id: <slrnbih6e2.doa.dhbrown@hobbes.dhbrown.net>

In article <slrnbih2u1.dcn.dhbrown@hobbes.dhbrown.net>, Dave Brown wrote:
> I'm trying to create a web page which has 2 frames, left and right. 
> In the left frame is a form to enter a number of data elements. In 
> the right frame, to start with, is some text with instructions.  The 
> user is to enter data into the left frame and submit, in which case 
> calculations take place, and the results are then displayed in the 
> right frame.  (The data is to be retained in the left frame in case 
> the user wants to make some changes to it, and resubmit.)
> ... 

Hmm...  Never mind.  If I (the script) just "print" out the html
it seems to display in the right frame without me doing anything to 
"target" it.

-- 
Dave Brown  Austin, TX


------------------------------

Date: Thu, 31 Jul 2003 04:25:44 GMT
From: "mgarrish" <mgarrish@rogers.com>
Subject: Re: Web page with frames...
Message-Id: <cT0Wa.40104$rsJ.14746@news04.bloor.is.net.cable.rogers.com>


"Dave Brown" <dhbrown@hobbes.dhbrown.net> wrote in message
news:slrnbih2u1.dcn.dhbrown@hobbes.dhbrown.net...
>
> I've got the code written for the left frame.  I've got code written to
> do the calculations.  Here's the question: when I submit the form, which
> kicks off the CGI script to do the calculations, what do I do (I presume)
> in the CGI script to get it to send the result to the frame on the right?
>

You do it all in javascript. Put a "javascript: void 0" on the submit button
so that the page you don't want to change doesn't, and the then create a
function to change the other page with data from the first (i.e., get the
values from your form, create a link to your cgi script including those
values and then use top.frameiwantochange.location.href to update the page).
Sometimes its just easier to create an invisible form that mirrors the one
in the frame you want to display your results in, copy all the current
values over when the user clicks submit, and then submit that form. I'm sure
there are other ways, too, but you're going to have to do it all on the
client side.

Matt




------------------------------

Date: Thu, 31 Jul 2003 04:56:01 GMT
From: "Mark" <none@given.com>
Subject: Re: Web page with frames...
Message-Id: <Bj1Wa.15919$cF.7149@rwcrnsc53>


<original message snipped for brevity>

> I've got the code written for the left frame.  I've got code written to
> do the calculations.  Here's the question: when I submit the form, which
> kicks off the CGI script to do the calculations, what do I do (I presume)
> in the CGI script to get it to send the result to the frame on the right?
> --
> Dave Brown  Austin, TX

According to the O'Reilly's HTML- the definitive guide (the Koala book), the
form tag has a target attribute. Simply add 'target=<right frame>' to the
form tag to notify the browser that form results should be displayed on the
right.

You might also consider dropping the whole framing concept and simply return
the completed form as part of the CGI output- this would increase
compatibility and eliminate issues with synchronizing frames and 'back'
button presses.

I'm not saying that separate <form> and <output> data is necessarily bad,
but IMHO managing some data on the client side and some server side is more
difficult than evaluating (and responding to) all the data as a fresh
transaction.






------------------------------

Date: Thu, 31 Jul 2003 05:52:19 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Web page with frames...
Message-Id: <n82Wa.16872$yv1.7931@nwrddc02.gnilink.net>

Dave Brown wrote:
> [...] web page [...] frames[...] form [...] submit [...]
> right frame [...] left frame [...] CGI [...] html [...]
> page [...] button [...]

None of that has anything to do with Perl whatsoever.
Do you have any Perl-related question, too?

jue




------------------------------

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 5296
***************************************


home help back first fref pref prev next nref lref last post