Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inne][HTML]checkbox - dwa zdarzenia onClic - problem
kotek2185
post
Post #1





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 7.12.2011

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


Witam wszystkich, mam taki o to form:

  1. ZEC<input type="checkbox" name="zec" id="zec" value="1" onclick="this.form.elements['tar'].disabled = !this.checked, this.form.elements['wys'].disabled = this.form.elements['co'].disabled = this.form.elements['cw'].disabled = this.checked"><br><br>
  2.  
  3. Taryfa<select onchange="this.form.elements['wys'].disabled = this.form.elements['co'].disabled = this.form.elements['cw'].disabled = (this.value=='0'), this.form.elements['wys'].disabled=!(this.value=='1'),
  4. this.form.elements['co'].disabled = this.form.elements['cw'].disabled = !(this.value=='2')" name="tar" value="tar" disabled = "disabled">
  5.  
  6. <option value="0" selected = "selected">Wybierz</option>
  7. <option value="1">Taryfa A</option>
  8. <option value="2">Taryfa B</option>
  9.  
  10. </select>
  11. <br><br>
  12.  
  13.  
  14. WYS <input type="text" name="wys" disabled = "disabled"><br><br>
  15.  
  16. CO <input type="text" name="co" disabled = "disabled"><br><br>
  17.  
  18. CW <input type="text" name="cw" disabled = "disabled"><br><br>
  19.  
  20. </form>


i pytanie jak obsłużyć checkbox by gdy zaznaczony odkrywał tylko select, a gdy odznaczony to zakrywał i select i inputy (które odkrywaja się zależnie od optiona w select)?

bardzo proszę o jakieś sugestie?

Ten post edytował kotek2185 17.05.2012, 09:52:55
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 19.08.2025 - 22:08