Connecting Tech Pros Worldwide Help | Site Map

Need help with posting to CGI from javascript

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 03:11 PM
Stacey
Guest
 
Posts: n/a
Default Need help with posting to CGI from javascript

Here is a function that is declared in my html page. It is part of a series
of javascript that allows the user to draw a rectangle on a graphic. This
is called when the box is done, so I would like to send the screen coords
which I know already to a cgi script at this point below. Can anybody help
me?

Somebody mentioned this code, but I am not sure how exactly to go about and
where to put code etc etc. It uses the urlconnection. Not sure of syntax.
Thanks again.
http://www.javaworld.com/javaworld/j...javatip34.html



function dragDone(x,y) {
startlayer.moveTo(iX,iY)
alert("Box is done")

need to post to cgi here

}




  #2  
Old July 20th, 2005, 03:11 PM
Miguel De Anda
Guest
 
Posts: n/a
Default Re: Need help with posting to CGI from javascript


"Stacey" <stacye@optonline.net> wrote in message
news:uiJPa.21724$hY1.6513370@news4.srv.hcvlny.cv.n et...[color=blue]
> Here is a function that is declared in my html page. It is part of a[/color]
series[color=blue]
> of javascript that allows the user to draw a rectangle on a graphic. This
> is called when the box is done, so I would like to send the screen coords
> which I know already to a cgi script at this point below. Can anybody[/color]
help[color=blue]
> me?
>
> Somebody mentioned this code, but I am not sure how exactly to go about[/color]
and[color=blue]
> where to put code etc etc. It uses the urlconnection. Not sure of[/color]
syntax.[color=blue]
> Thanks again.
> http://www.javaworld.com/javaworld/j...javatip34.html
>
>
>
> function dragDone(x,y) {
> startlayer.moveTo(iX,iY)
> alert("Box is done")
>
> need to post to cgi here
>
> }
>
>
>[/color]

function dragDone(x,y) {
startlayer.moveTo(iX,iY);
alert("Box is done");

if ("java"=="javscript") {
alert("Ask question in comp.lang.java.help");
} else {
alert("Ask question in comp.lang.javascript");
}
}








But if you really want to know, this is what I like to do:

I create a hidden frame, be it an iframe or from a frameset. Have a form in
there that will receive data from the dragDone(x,y) function. Submit the
form to you cgi. This will prevent the main window from submiting the data
(and prevent the user from doing more things). From what I'm guessing, you
may need some way to buffer the input and send larger packets of input
together.


  #3  
Old July 20th, 2005, 03:12 PM
Ron Savage
Guest
 
Posts: n/a
Default Re: Need help with posting to CGI from javascript

"Stacey" <stacye@optonline.net> wrote in message
news:uiJPa.21724$hY1.6513370@news4.srv.hcvlny.cv.n et...[color=blue]
> Here is a function that is declared in my html page. It is part of a[/color]
series[color=blue]
> of javascript that allows the user to draw a rectangle on a graphic. This
> is called when the box is done, so I would like to send the screen coords
> which I know already to a cgi script at this point below. Can anybody[/color]
help


# 30:

http://savage.net.au/Perl-tuts-1-30.html

--
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.