<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"> <script language="JavaScript"> <!------------- function HideIt() { document.getElementById('required').style.visibility= "hidden"; document.getElementById('requiredtext').style.visibility= "hidden"; } function CheckEmptyField( theField, theMessage ) { if( theField.value=="" ) { theField.focus(); if(document.getElementById) { document.getElementById('required').style.visibility= "visible"; document.getElementById('requiredtext').style.visibility= "visible"; document.getElementById('requiredtext').innerHTML= theMessage; setTimeout( "HideIt()",1500); } else { alert(theMessage); } return false; } else { return true; } } function Validate(theForm) { if( !CheckEmptyField(theForm.name,"Vyplňte prosím pole jméno.") ) return false; if( !CheckEmptyField(theForm.surname,"Vyplňte prosím pole příjmení.") ) return false; if( !CheckEmptyField(theForm.email,"Vyplňte prosím pole e-mail.") ) return false; // uspech return true; } //--------------> </script> <title>Kontrola formuláře s obrázky</title> </head> <body bgcolor="#9DCEFF" text="#000000"> <h2 align="left">Kontrola formuláře s obrázky</h2> <form method="POST" onSubmit="return Validate(this);"> <table border="0" cellpadding="0" cellspacing="0" width="400" height="124"> <tr> <td height="25">Jméno:</td> <td height="25"><input type="text" name="name" size="20"><font color="#FF0000">*</font></td> </tr> <tr> <td height="25">Příjmení:</td> <td height="25"><input type="text" name="surname" size="20"><font color="#FF0000">*</font></td> </tr> <tr> <td height="25">E-mail:</td> <td height="25"><input type="text" name="email" size="20"><font color="#FF0000">*</font></td> </tr> <tr> <td height="22">Počet vlasů:</td> <td height="22"><input type="text" name="hair_count" size="9"></td> </tr> <tr> <td height="27"> </td> <td height="27"><input type="submit" value="Submit" name="B1"></td> </tr> <tr> <td height="27"></td> <td height="27"><small>Poznámka: hvězdička <font color="#FF0000">*</font> značí povinné pole.</small></td> </tr> </table> </form> <script language="JavaScript"><!------------- if(document.getElementById) { document.write('<img ID="required" STYLE="visibility:hidden; position:absolute; left:300; top:120" src="required.gif">'); document.write('<p ID="requiredtext" STYLE="visibility:hidden; position:absolute; left:365; top:155" >abc</p>'); } //-----------></script> </body> </html>