<script> function checkImie(whatYouTyped) { var fieldset = whatYouTyped.parentNode; var txt = whatYouTyped.value; if ((/^([a-zA-Z±ćęłńó¶ĽżˇĆĘŁŃÓ¦¬Ż])*([ ]?)([a-zA-Z±ćęłńó¶ĽżˇĆĘŁŃÓ¦¬Ż]?)*$/.test(txt)) && (txt.length > 2)) { fieldset.className = "welldone"; } else { fieldset.className = ""; } checkForm(); } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } function prepareInputsForHints() { var inputs = document.getElementsByTagName("input"); for (var i=0; i < inputs.length; i++){ inputs[i].onfocus = function () { this.parentNode.getElementsByTagName("span")[0].style.display = "inline"; } inputs[i].onblur = function () { this.parentNode.getElementsByTagName("span")[0].style.display = "none"; } } checkImie(document.getElementById('Imie')); checkForm(); } // Funkcja sprawdza czy wypełniono wszystkie wymagane pola formularza function checkForm() { if( document.getElementById('Imie').parentNode.className == "welldone") document.getElementById('submit').disabled = false; else document.getElementById('submit').disabled = true; } addLoadEvent(prepareInputsForHints); </script> <form id='frm' action='#.php' method='post'> <input class='in_frm' type='text' id='imie' name='txtImie' maxlength='50' onkeyup='checkImie(this);' /> </form>
obecnie pole input po poprawnym wypełnieniu jest odznaczane tzn. obok pola pojawia się ikonka "ptaszek" że wszystko gra. Czy jest możliwo¶ć doł±czenia walidacji dla radio buttona do obecnej już, to znaczy je¶li wybiore jaki¶ rodio butonn o tym samym name to mi go odznaczy że wszystko gra itp.
W sieci znalazłem przykłady sprawdzania radiobuttona np taki: