HighDots Forums  

getElementById e option

Javascript (Italian) Il linguaggio JavaScript (it.comp.lang.javascript)


Discuss getElementById e option in the Javascript (Italian) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
(-: Dan :-)
 
Posts: n/a

Default getElementById e option - 10-27-2003 , 07:15 AM






ciao a tutti
in una situazione del genere

<input type="Radio" class="RadioButton" name="optBanca" id="optBanca"
value="1" readonly>banca1
<input type="Radio" class="RadioButton" name="optBanca" id="optBanca"
value="2" readonly>banca2

come faccio a disabilitare gli oggetti con

document.getElementById("optBanca").disabled = true

se sono un array?

grazie
Daniele


Reply With Quote
  #2  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: getElementById e option - 10-27-2003 , 07:17 AM






l'id deve essere univoco in una pagina, a cosa ti serve mettere 2 id? Non
puoi usare la collection forms?



Reply With Quote
  #3  
Old   
(-: Dan :-)
 
Posts: n/a

Default Re: getElementById e option - 10-27-2003 , 07:49 AM





Cristiano Larghi wrote:

Quote:
l'id deve essere univoco in una pagina, a cosa ti serve mettere 2 id? Non
puoi usare la collection forms?
"collection forms"? che è?
gli option devono avere lo stesso nome per essere esclusivi...



Reply With Quote
  #4  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: getElementById e option - 10-27-2003 , 07:52 AM



Stesso name, non stesso id
getElementsByName, infatti, ti restituisce una collection (e puoi ciclarla),
mentre getElementById ti restituisce un oggetto (perché l'id dovrebbe essere
univoco)



Reply With Quote
  #5  
Old   
(-: Dan :-)
 
Posts: n/a

Default Re: getElementById e option - 10-27-2003 , 08:21 AM





Cristiano Larghi wrote:

Quote:
Stesso name, non stesso id
getElementsByName, infatti, ti restituisce una collection (e puoi ciclarla),
mentre getElementById ti restituisce un oggetto (perché l'id dovrebbe essere
univoco)
ah ok, perfetto.
grazie



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.