Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> label
Ogotay
post
Post #1





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 29.12.2005

Ostrzeżenie: (0%)
-----


Mam checkbox i label

Chcialbym w OnMouseOver labela wywolac alerta wyswietlajacego id checkboxa.
Go to the top of the page
+Quote Post
TomASS
post
Post #2





Grupa: Zarejestrowani
Postów: 1 660
Pomógł: 13
Dołączył: 9.06.2004
Skąd: Wrocław i okolice

Ostrzeżenie: (0%)
-----


Nie za bardzo rozumiem, ale przyda Ci się:

1. getElementByID();
2. alert();
3. <label id="identyfikator"></label>
4. onMouseOver
Go to the top of the page
+Quote Post
Ogotay
post
Post #3





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 29.12.2005

Ostrzeżenie: (0%)
-----


  1. <INPUT TYPE="CHECKBOX" NAME="checkbox.12" ID="checkbox12.1" VALUE="3" CHECKED OnMouseOver="javascript:n_z_wielu(this.name)" OnChange="javascript:fx_js_zapis(this.id,this.type);n_z_wielu(this.name)">
  2.  
  3. <label for="checkbox12.1" OnMouseOver="javascript:alert(this.(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) )">label dla checboxa</label>


Checkboxow jest duzo i nazywane dynamicznie.
Chodzi o to by przy pomocy labela dobrac sie do checkboxa

(this.for nie dziala)

Ten post edytował Ogotay 28.02.2006, 14:00:34
Go to the top of the page
+Quote Post
TomASS
post
Post #4





Grupa: Zarejestrowani
Postów: 1 660
Pomógł: 13
Dołączył: 9.06.2004
Skąd: Wrocław i okolice

Ostrzeżenie: (0%)
-----


Aby dobrać się do dowolnego elementu (jego wartości) przu pomocy JS:
  1. function $(id){
  2. return document.getElementById(id);
  3. }
  4.  
  5. alert($('checkbox12.1').value);
Go to the top of the page
+Quote Post
Ogotay
post
Post #5





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 29.12.2005

Ostrzeżenie: (0%)
-----


label jest zwiazany z checkboxem.
pytanie brzmi:
czy korzystajac z tego powiazania da sie poprzez metode labela ustalic do ktorego checkboxa dany label jest przywiazany?
Go to the top of the page
+Quote Post
nospor
post
Post #6





Grupa: Moderatorzy
Postów: 36 561
Pomógł: 6315
Dołączył: 27.12.2004




  1. <input type="checkbox" id="test" /> <label for="test" onmouseover="alert(this.getAttribute('for'));">testsaasd</label>
Go to the top of the page
+Quote Post
Ogotay
post
Post #7





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 29.12.2005

Ostrzeżenie: (0%)
-----


dzieki
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.12.2025 - 14:09