Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: RE: disable select object in ie5 and ns 4+ 3D error


Message #1 by Francisco de Jesus Orozco Ruiz <fjor@g...> on Tue, 29 Jan 2002 07:32:31 -0600 (CST)
Hi Francisco;

Infact the last line which says Count=3D0; is required because, the size
of the dropdown box keeps dynamically decreasing as and when i remove an
option from it.

In the same example,the size of the select2 box is initially 4, and when
the loop executes for the first time,one option si removed from the
dropdown box.Noe when it checks the for condition again, the size will
be 3.
If count were not equated to zero, then the for condition looks
something like this:

for(Count=3D1;Count<3;Count++)

and for the next iteration it will be :

for(Count=3D 2; Count<2;Count++)

and the code will not be executed after this which results in only two
of the four values being removed from the
dropdown box and this is definitely not something that is required.

Thanks and Regards,
Nitin.

-----Original Message-----
From: Francisco de Jesus Orozco Ruiz [mailto:fjor@g...]
Sent: Tuesday, January 29, 2002 7:03 PM
To: JavaScript HowTo
Subject: [javascript_howto] RE: disable select object in ie5 and ns 4+
3D error


Hi! Regarding the strange 3D characters in the code,
very often the mailers systems need to mask some symbols,
like the equal sign or the quotes, so they convert them
to something different. Is too bad that not all of the
programs talk the same, and do not know how to change back.

Simply ignore the weird codes to get a sintactically
correct program. By example, I edited the first function
dropping the 3Ds (sorry if some dumb program insert them
again!):

Part of your message edited...
>   Subject: RE: disable select object in ie5 and ns 4+
>   From: \"sokuntheary en\" <soken78@y...>
          :
>   I dont understand the code that you have provided.  What is 3D?  I
copied
>   and pasted the code into homesite and there is an error in the
javascript
>   a missing \';\'.

   > function fun(){
   > Count=3D0;
   > if(document.frmForm.select1.value=3D=3D\"two\"){
   > for(Count=3D0; Count<=3Ddocument.frmForm.select2.length ;Count++){
   > removeOption=3Dnew
   >
Option(document.frmForm.select2[0].value,document.frmForm.select2[0].val
   > ue);
   > document.frmForm.select2.remove(removeOption,[0]);
   > // Count=3D0;  // REMOVE THIS LINE
   > }

Note that the last line using the Count variable must be deleted because
resets the for condition, so Count will never reach the length value!

Sorry, I could not check the full code!
Regards
Francisco

------
Ing. Francisco de Jesus Orozco Ruiz
Division de Informatica - CETI, Guadalajara, Mexico
fjor@g...
fjor@m...

$subst('Email.Unsub').

  Return to Index