Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Retrieving value from HTML->Javascript->Perl

by TexasTess (Beadle)
on Jul 07, 2002 at 00:04 UTC ( #179901=note: print w/replies, xml ) Need Help??


in reply to Retrieving value from HTML->Javascript->Perl

The following screams at me from your code:
win=window.open("cgibin/getPrice.pl?textBox="+text,"","width=250,heigh+t=240")

Should read:
win=window.open("cgibin/getPrice.pl?textBox='+text+' ","width=250,height=240")

See the difference?

TexasTess
  • Comment on Re: Retrieving value from HTML->Javascript->Perl

Replies are listed 'Best First'.
Re: Re: Retrieving value from HTML->Javascript->Perl
by dws (Chancellor) on Jul 07, 2002 at 00:30 UTC
    Should read:
    win=window.open("cgibin/getPrice.pl?textBox='+text+' ","width=250,height=240")

    Nope. Not unless the CGI expects the string to arrive with single quotes around it. I suspect that the right thing to do here is to URL-encode 'textBox', via

    win=window.open("cgibin/getPrice.pl?textBox=" + escape(text), "width=250,height=240")
      I've just written some code almost exactly like this..but it's at work and I'm at home..and my brain is fried so can't remember the EXACT syntax I used however....

      I've found that when trying to use quotes inside a quoted string the CGI converts the ' nicely...but leave the " in and it screws it up...ALSO shouldn't there be a "+" on either side of the variable?
      Texas Tess

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://179901]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2023-09-30 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?