Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: javascript variable & perl

by screamingeagle (Curate)
on Feb 25, 2002 at 20:31 UTC ( #147372=note: print w/ replies, xml ) Need Help??

in reply to javascript variable & perl

hmm...i'm not quite clear on what exactly you need...if its setting a form variable using javascript and passing it to a perl script, then here's one way to do it

<html> <head> <script language="Javascript"> function callSubmitSub() { var objForm = document.test; var testvar =; objForm.passedvar1.value = testvar; alert(objForm.passedvar1.value);} </script> </head> <body> <form name="test" action="" method="post" onSubmit="callSubmitS +ub();"> <input type=hidden name="passedvar1" value=""> <input type=submit value="submit"> </form> </body> </html>
this passes the value of the javascript variable into a hidden variable in the form, which in turn is passed to the perl script when the form is submitted.

Comment on Re: javascript variable & perl
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (14)
As of 2015-11-30 13:10 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (770 votes), past polls