Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

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

Entry

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
...
</script>
...
<form name=test action="catchinfo.html"  -- 
onsubmit="this.myvarfield.value=myVar;">
<input type=text name=yourname>
<input type=hidden name=myvarfield>
</form>
http://www.forums.msryat.org
http://www.msryat.org
http://www.dir.msryat.org
http://www.games.msryat.org
http://www.3lmbnat.com
http://www.dir.3lmbnat.com
http://www.vb.3lmbnat.com
http://www.qtryat.com
http://www.qtryat.com/vb
http://forums.msryat.org/forumdisplay.php?f=2
http://forums.msryat.org/forumdisplay.php?f=3
http://forums.msryat.org/forumdisplay.php?f=84
http://forums.msryat.org/forumdisplay.php?f=4
http://forums.msryat.org/forumdisplay.php?f=118
http://forums.msryat.org/forumdisplay.php?f=44
http://forums.msryat.org/forumdisplay.php?f=69
http://forums.msryat.org/forumdisplay.php?f=85
http://forums.msryat.org/forumdisplay.php?f=91
http://forums.msryat.org/forumdisplay.php?f=70
http://forums.msryat.org/forumdisplay.php?f=73
http://forums.msryat.org/forumdisplay.php?f=57
http://forums.msryat.org/forumdisplay.php?f=6
http://forums.msryat.org/forumdisplay.php?f=7
http://forums.msryat.org/forumdisplay.php?f=61
http://forums.msryat.org/forumdisplay.php?f=68
http://forums.msryat.org/forumdisplay.php?f=92
http://forums.msryat.org/forumdisplay.php?f=101
http://forums.msryat.org/forumdisplay.php?f=10
http://forums.msryat.org/forumdisplay.php?f=11
http://forums.msryat.org/forumdisplay.php?f=43
http://forums.msryat.org/forumdisplay.php?f=51
http://forums.msryat.org/forumdisplay.php?f=81
http://forums.msryat.org/forumdisplay.php?f=80
http://forums.msryat.org/forumdisplay.php?f=14
http://forums.msryat.org/forumdisplay.php?f=15
http://forums.msryat.org/forumdisplay.php?f=16
http://forums.msryat.org/forumdisplay.php?f=87
http://forums.msryat.org/forumdisplay.php?f=18
http://forums.msryat.org/forumdisplay.php?f=50
http://forums.msryat.org/forumdisplay.php?f=90
http://forums.msryat.org/forumdisplay.php?f=89
http://forums.msryat.org/forumdisplay.php?f=95
http://forums.msryat.org/forumdisplay.php?f=102
http://forums.msryat.org/forumdisplay.php?f=19
http://forums.msryat.org/forumdisplay.php?f=20
http://forums.msryat.org/forumdisplay.php?f=21
http://forums.msryat.org/forumdisplay.php?f=71
http://forums.msryat.org/forumdisplay.php?f=96
http://forums.msryat.org/forumdisplay.php?f=98
http://forums.msryat.org/forumdisplay.php?f=97
http://forums.msryat.org/forumdisplay.php?f=99
http://forums.msryat.org/forumdisplay.php?f=100
http://forums.msryat.org/forumdisplay.php?f=52
http://forums.msryat.org/forumdisplay.php?f=66
http://forums.msryat.org/forumdisplay.php?f=23
http://forums.msryat.org/forumdisplay.php?f=24
http://forums.msryat.org/forumdisplay.php?f=25
http://forums.msryat.org/forumdisplay.php?f=26
http://forums.msryat.org/forumdisplay.php?f=62
http://forums.msryat.org/forumdisplay.php?f=63
http://forums.msryat.org/forumdisplay.php?f=65
http://forums.msryat.org/forumdisplay.php?f=64
http://forums.msryat.org/forumdisplay.php?f=47
http://forums.msryat.org/forumdisplay.php?f=67
http://forums.msryat.org/forumdisplay.php?f=48
http://forums.msryat.org/forumdisplay.php?f=29
http://forums.msryat.org/forumdisplay.php?f=86
http://forums.msryat.org/forumdisplay.php?f=49
http://forums.msryat.org/forumdisplay.php?f=30
http://forums.msryat.org/forumdisplay.php?f=31
http://forums.msryat.org/forumdisplay.php?f=88
http://forums.msryat.org/forumdisplay.php?f=32
http://forums.msryat.org/forumdisplay.php?f=33
http://forums.msryat.org/forumdisplay.php?f=78
http://forums.msryat.org/forumdisplay.php?f=34
http://forums.msryat.org/forumdisplay.php?f=103
http://forums.msryat.org/forumdisplay.php?f=109
http://forums.msryat.org/forumdisplay.php?f=104
http://forums.msryat.org/forumdisplay.php?f=105
http://forums.msryat.org/forumdisplay.php?f=106
http://forums.msryat.org/forumdisplay.php?f=108
http://forums.msryat.org/forumdisplay.php?f=110
http://forums.msryat.org/forumdisplay.php?f=111
http://forums.msryat.org/forumdisplay.php?f=112
http://forums.msryat.org/forumdisplay.php?f=113
http://forums.msryat.org/forumdisplay.php?f=114
http://forums.msryat.org/forumdisplay.php?f=115
http://forums.msryat.org/forumdisplay.php?f=116
http://forums.msryat.org/forumdisplay.php?f=117
http://forums.msryat.org/forumdisplay.php?f=36
http://forums.msryat.org/forumdisplay.php?f=37
http://forums.msryat.org/forumdisplay.php?f=72
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com