Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: =?iso-8859-1?Q?RE=3A_=5Bjavascript=5D_Re=3A_JScript_Sintax_=28?=---=?iso-8859-1?Q?Elements=29_For_Hans_J=F6rg__Friedrich?=


Message #1 by PERRETTA Franco <Franco.PERRETTA@c...> on Mon, 15 Jan 2001 10:54:41 +0100
Thank you very, very much, your help was superb.

             Franco
___________________________________
                     Perretta Franco
                           Council of Europe
           Department of Information Technology
                      Information Access Unit
                     67075 Strasbourg Cedex
tel: +33 (0)3 88 41 22 18  fax: +33 (0)3 88 41 27 39
          mailto:franco.perretta@c...
                    http://www.coe.int

 -----Original Message-----
From: 	Hans J=F6rg Friedrich [mailto:hans.friedrich@n...]
Sent:	Monday 15 January 2001 10:14
To:	javascript
Subject:	[javascript] Re: JScript Sintax (Elements)

Hi Franco!

You will never reach any code inside the  for-block
If i=3D1 i can't be 31
I think you ment:

for(i=3D1;i<=3D31;i++)...

if you use elements[...] a string inside the brackets is expected. 
Therefore
you simply need to concat the two substrings. If "MornHourArr" is a 
constant
string:

if(FormButton.elements["MornHourArr"+i].value>23)

Greetings Hans

----- Original Message -----
From: "Franco" <francO.perretta@c...>
To: "javascript" <javascript@p...>
Sent: Monday, January 15, 2001 6:18 PM
Subject: [javascript] JScript Sintax (Elements)


> Hi,
> Some one could help me about the sintax in the ELEMENTS line.
> I can not join the name of the ELEMENTS and the variable i.
> I will appreciate your help
>
>   Franco
>
> 
file://-----------------------------------------------------------------

>   var i;
> function SumMorn()
>   {
>
>   for (i=3D1; i=3D31; i++)
>

> if (FormButton.elements["'MornHourArr' + i + '"].value>23)
>     {
>      alert("Vous aviez entre un horaire inexistent");
> FormButton.elements["'MornHourDep' + i + '"].focus();
> }
> else
> FormButton.elements["'MornHourTot' + i + '"].value =3D
> FormButton.elements["'MornHourDep' + i + '"].value -
> FormButton.elements["'MornHourArr' + i + '"].value;
>
>   }
> }
> file://-------------------------------------------------------
>

  Return to Index