<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <script type="text/javascript"> function $(id){ return document.getElementById(id); } function check(){ var wyslij = 1; var pola = ''; if(!($("nick").value)){ $("nick").style.border = '1px solid Red'; pola += ' Nick'; wyslij = 0; } else $("nick").style.border = '1px solid Black'; if(!($("mail").value)){ $("mail").style.border = '1px solid Red'; pola += ', E-mail'; wyslij = 0; } else $("mail").style.border = '1px solid Black'; if(!($("tresc").value)){ $("tresc").style.border = '1px solid Red'; pola += ', Treść'; wyslij = 0; } else $("tresc").style.border = '1px solid Black'; if(wyslij) $("formularz").sent(); else alert('Wypenij pola: '+pola); } </script> </head> <body> <form id="formularz" method="post" action="wyslij.php"> <fieldset> <div class="form"> <input id="nick" name="nick" class="text" type="text" /> </div> <div class="form"> <input id="mail" name="mail" class="text" type="text" /> </div> <div class="form"> </div> <div class="form"> <input id="submit" name="submit" class="submit" type="submit" value="Wyślij" onclick="check();"/> </div> </fieldset> </form>