🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.javascript
Article #48

Re: Please tell my why this won't work.

#48
From: Peng Khor
Date: Fri, 09 Aug 1996 00:00
62 lines
2977 bytes
Aaron Peterson wrote:
> 
> The Error:
> 
> JavaScript Error: file:/C|WINDOWS/Desktop/otog5.htm, line 7:
> Window.Document.Form.text1 has no property named 'value'.
> 
> The HTML and SCRIPT and FORM:
> 
> <html>
> <head>
> <script language="JavaScript">
> <!-- Hide
> 
> function test1(form) {
>   if (form.text1.value == "")
>     alert("Please enter a string!")
>   else {
>    if (form.text1.value == "INCOR")
>      parent.location.href="http://www.prostar.com/web/alpine/incor/";
>   else {
>    if (form.text1.value == "ALPine")
> 
> parent.location.href="http://www.prostar.com/web/alpine/welcome.htm";}
>    }
> }
> 
> // -->
> </script>
> </head>
> 
> <body>
> <form name="first" method="post">
> THE ORGANIZATION YOU WANT TO GOTO IS<br>
> <select name="test1">

1.0  The "test1" should be "text1"

>         <option selected value="ALPine">ALPine
>         <option value="INCOR">INCOR
> </select>
> <input type="button" name="button1" value="GOTO"
> onClick="test1(this.form)">
> <P>
> </form>
> </body>
> </html>

{snip}

2.0 The value for the selected "text1" is not picked up by the script. 
    I tested it. The script gives the value as "null".
    Perhaps, some more experienced in <FORM> can offer an explanation.

Peng Khor

-- 
=======================================================================
Peng Aun Khor		 Email	: Mailto:Peng.Khor@hydro.on.ca
H11 G04 Ontario Hydro	 Phone	: (416) 592 8396
Canada M5G 1X6		 Fax	: (416) 592 4849
Technical Details
Message-ID: <320B6065.71D6@hydro.on.ca>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4u7o8p$9j5@amber.ora.com> <320A3B5D.62DF@mail.prostar.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f7cbd,a6f41a01eab140ed
X-Google-Attributes: gidf7cbd,public
X-Google-Thread: 143f9e,a6f41a01eab140ed
X-Google-Attributes: gid143f9e,public
X-Google-Thread: 10aaab,a6f41a01eab140ed
X-Google-Attributes: gid10aaab,public
X-Google-Thread: 109f69,a6f41a01eab140ed
X-Google-Attributes: gid109f69,public
X-Google-Thread: fb3cb,a6f41a01eab140ed
X-Google-Attributes: gidfb3cb,public
X-Google-Thread: f5d71,a6f41a01eab140ed
X-Google-Attributes: gidf5d71,public
X-Google-Thread: 10d861,a6f41a01eab140ed
X-Google-Attributes: gid10d861,public
X-Google-Thread: fd796,a6f41a01eab140ed
X-Google-Attributes: gidfd796,public
From: Peng Khor <Peng.Khor@hydro.on.ca>
Subject: Re: Please tell my why this won't work.
Date: 1996/08/09
Message-ID: <320B6065.71D6@hydro.on.ca>
X-Deja-AN: 173156831
references: <4u7o8p$9j5@amber.ora.com> <320A3B5D.62DF@mail.prostar.com>
cc: clnet@ai.mit.edu, "Choi,John" <AE7343514@ntuvax.ntu.ac.sg>,
content-type: text/plain; charset=us-ascii
organization: Ontario Hydro, Canada
mime-version: 1.0
reply-to: Peng.Khor@hydro.on.ca
newsgroups: comp.lang.javascript,comp.lang.java.programmer.announce,comp.lang.java,alt.www.hotjava,biz.books.technical,misc.books.technical,alt.books.technical,comp.infosystems.www.authoring.cgi,comp.infosystems.www.authoring.html,comp.infosystems.www.authoring.misc,comp.infosystems.www.misc
x-mailer: Mozilla 3.0b6Gold (Win16; I)