[Javascript] "document.exf.dis" is not an object

Peter Brunone peter at brunone.com
Wed Jun 6 14:29:40 CDT 2001


    Your script is setting the value of document.exf.dis before the page
loads; the element does not exist yet.  If you want to set the radio button
to be checked, just use the CHECKED attribute inside the HTML, like this:

<input type="radio" name="dis" value="0" CHECKED
onclick="document.exf.disabled.value=0">

Cheers,

Peter

----- Original Message -----
From: "yahress nataf" <yna54 at hotmail.com>
To: <javascript at LaTech.edu>
Sent: Wednesday, June 06, 2001 6:05 PM
Subject: [Javascript] "document.exf.dis" is not an object


> I got this error :
> "document.exf.dis" is not an object
>
> here is the code :
> <html>
>
> <head>
> <script>
> document.exf.dis.value=1;
> function change(_i) {
>   if (document.exf.disabled.value==1) return;
>   eval("document.exf.c"+_i+".checked = ! document.exf.c"+_i+".checked");
> }
> </script>
> </head>
>
> <body>
> <BR>
> <form name=exf>
>
> <h4><font face="Tahoma, Verdana, Arial, sans-serif" color="#006600"><img
> border="0" src="statestreet.gif" width="295"
> height="118">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></h4>
> <h4 align="left"><font face="Tahoma, Verdana, Arial, sans-serif"
>
color="#006600">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> TRAINING AND DEVELOPMENT</font></h4>
> <p><font face="Tahoma, Verdana, Arial, sans-serif" size="2"><b>Q.1) Career
> Development Opportunities were available to me.</B></font></p>
> <p>
> YES<input type="radio" name="dis" value="0"
> onclick="document.exf.disabled.value=0"><br>
> NO<input type="radio" name="dis" value="1"
> onclick="document.exf.disabled.value=1" checked><br>
> <p><b>
> Q.1a. YES</b>,&nbsp;
> <p>
> <b>What opportunities did you benefit from?</b>
>
> <p><font face="Tahoma, Verdana, Arial, sans-serif" size="2">1 <input
> type="checkbox" name="Ins" value="Yes" onclick="change(1)"><b>Institute
> Classes<br>
>   2 <input type="checkbox" name="instit" value="Yes" onclick="change(2)"
> checkbox">Educational Assistance<br>3
> <input type="checkbox" name="necf" value="Yes" onclick="change(3)">NECF
> Courses<br>
>   4 <input type="checkbox" name="icdp" value="Yes"
> onclick="change(4)">ICDP<br>
>   5 <input type="checkbox" name="virtinst" value="Yes"
> onclick="change(5)">Virtual Institute<br>
>   6 <input type="checkbox" name="mentoring3" value="Yes"
> onclick="change(6)">Mentoring program</b>
> &nbsp;</font>
>
> <p><font face="Tahoma, Verdana, Arial, sans-serif" size="2">
>   7<input type="checkbox" name="mentoring" value="Yes"
> onclick="change(7)"><b>One on
> One Job Training&nbsp;</b></font>
>
> <p><font face="Tahoma, Verdana, Arial, sans-serif" size="2">
> <b>8<input type="checkbox" name="other" value="Yes"
> onclick="change(8)">Other&nbsp;</b></font>
>
> &nbsp;<BR>
> <input type=hidden name=disabled value=1>
>
> </form>
>
> </body>
> </html>





More information about the Javascript mailing list