Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

64 of 163 people (39%) answered Yes
Recently 1 of 10 people (10%) answered Yes


I need to pass a global variable javascript to html form. I have 4or5 variables but need to pass one
This example is useful but it would be more if you'd shown how to access to your global variable now

Feb 24th, 2009 23:16
haytham ali, ha mo, Bob John, Noodles Smash, CÚdric Levasseur,

I always put it into a hidden field with an onsubmit on the form:
<script language=javascript>
var myVar = 3
<form name=test action="catchinfo.html"  -- 
<input type=text name=yourname>
<input type=hidden name=myvarfield>