[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re: [ic] set variable using Javascript???
At 03:20 PM 7/3/2001 -0400, you wrote:
>I am working on a site that has a dhtml menu. We have three versions of
>the navigation and when someone first comes to the site we redirect them
>to an index page which sets a menutype variable.
>
>The problems is if someone come to the site directly to a page other than
>the index this variable never gets set. Detecting which browser they have
>is no problem but can I set a variable using javascript?
You can set [value]'s via javascript. E.g., use a hidden form value.
<INPUT type=hidden name=browsertype>
<SCRIPT>
function set_browser(form) {
form.browsertype.value = "Netscape";
return 0;
}
</SCRIPT>
You also need something to call set_browser(this.form), probably best from
<BODY ... onLoad()> or whatever it is.
on the next page (or in mv_check) you can access it with:
[value browsertype]
I hope that helps,
Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com