🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.javascript
Article #2

Scope problem of <select> variable

#2
From: Koen Appeltans
Date: Tue, 11 Dec 2001 11:00
21 lines
1625 bytes
Hello,

I'm having a problem with the following HTML/javascript code:

 <SELECT onchange="VPEchanged" id=verpleeg name=verpleeg size=1>
 <OPTION value = 0>Geen</OPTION>
<OPTION value = 1>Test</OPTION>
 </SELECT>
 <SCRIPT language="javascript">
 verpleeg.options[1].selected = true;
</SCRIPT>

he gives an error in the script : verpleeg is not defined
Why can't I use that variable anymore ?? How can I solve this problem ??

It's probably a very basic question, but I've been searching now for a while
allready, so I'd really appreciate some help!

Tnx in advance,

Koen Appeltans
Technical Details
Message-ID: <3c4ca164.0112110300.171bba29@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb3cb,8ba4077ea8cb7b44,start
X-Google-Attributes: gidfb3cb,public
X-Google-Thread: 100e17,8ba4077ea8cb7b44,start
X-Google-Attributes: gid100e17,public
X-Google-Thread: f9a35,8ba4077ea8cb7b44,start
X-Google-Attributes: gidf9a35,public
X-Google-ArrivalTime: 2001-12-11 03:00:24 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: koenappeltans@hotmail.com (Koen Appeltans)
Newsgroups: comp.lang.javascript,alive.internet.lang.html,alive.internet.lang.javascript
Subject: Scope problem of <select> variable
Date: 11 Dec 2001 03:00:24 -0800
Organization: http://groups.google.com/
Lines: 21
Message-ID: <3c4ca164.0112110300.171bba29@posting.google.com>
NNTP-Posting-Host: 195.13.24.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1008068424 20551 127.0.0.1 (11 Dec 2001 11:00:24 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 11 Dec 2001 11:00:24 GMT