Potrzebuję zrobić czyszczenie pola INPUT TEXT po zaznaczeniu checkboxa, poniżej kod .js który robi mi po zaznaczeniu go (disable INPUT TEXT`a).

  1. <?php
  2. print "<script LANGUAGE="JavaScript">";
  3. print "function func() {";
  4. print "if(document.getElementById('blok').checked == true) {";
  5. print "document.getElementById('timestamps').disabled = false;";
  6.  print "}";
  7.  print "else document.getElementById('timestamps').disabled = true;";
  8.  print "document.getElementById('timestamps').text.value='';";
  9. print "}";
  10. print "</script>";
  11. ?>


Zastosowałem

  1. <?php
  2. print "document.getElementById('timestamps').text.value='';";
  3. ?>


ale bez efektu.

EDIT: Rozwiązanie stało się proste smile.gif

  1. <?php
  2. print "document.getElementById('timestamps').value='';";
  3. ?>