[thelist] Passing A Javascript Variable's Value Into a CGI Sc ript (PERL)

Scott Dexter sgd at ti3.com
Wed, 1 Dec 1999 11:47:54 -0600


you're almost there, actually. take a look at the code below (yours with my
mods)

sgd
--
think safely

> <HTML>
> <HEAD>
> <TITLE>Browser Sniffer</TITLE>
> 
> <SCRIPT LANGUAGE="JavaScript">
> 
> <!--
>    var agt = navigator.userAgent.toLowerCase();
> 
>    var is_nav     = ( ( agt.indexOf( 'mozilla' ) != -1 ) &&
>                       ( agt.indexOf( 'spoofer' ) == -1 ) &&
>                       ( agt.indexOf( 'compatible' ) == -1 ) &&
>                       ( agt.indexOf( 'opera' ) == -1 ) &&
>                       ( agt.indexOf( 'webtv' ) == -1 ) );

	document.simpleform.TestVar.value = is_nav;
> -->
> </SCRIPT>
> 
> </HEAD>
> 
> <BODY>

<!-- **Always name your forms! ** -->
>    <FORM action="/cgi-bin/SomeCGIScript.cgi" method="POST"
name="simpleform">

<!-- make the initial (default) value something you can use -->
>       <input type="hidden" name="TestVar" value="undef">

>    </FORM>
> </BODY>
> 
> </HTML>