<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> function wyslijDane() { var przyciskEL = document.getElementById("bWyslij"); var div = document.getElementById("warstwaDanych"); var tfImie = document.getElementById("tfImie"); var tfNazwisko = document.getElementById("tfNazwisko"); var imie = tfImie.value; var nazwisko = tfNazwisko.value; imie = escape(imie); nazwisko = escape(nazwisko); przyciskEL.disabled = true; var text = XMLHttpRequestObject.responseText; if (nazwisko.length==0)) { tekst = "Wypełnij wszystkie pola!"; } } div.innerHTML = tekst; przyciskEL.disabled = false; XMLHttpRequestObject.send(null); </script> </head> <body> <div> Imię: <input type="text" id="tfImie" /> Nazwisko <input type="text" id="tfNazwisko" /> <input type="button" value="Wyślij" onclick="wyslijDane();" id="bWyslij" /> </div> </body> </html>