Начало
Формы
No Entry
Используйте JavaScript, чтобы гарантировать, что посетители не оставляют незаполненный вход формы. Если они делают, они побуждены закончить это прежде, чем они смогут продолжить
JavaScript Forms: No Entry
<!-- THREE STEPS TO INSTALL NO ENTRY: 1. Paste the coding into the HEAD of your HTML document 2. Put the last code into the BODY of your HTML document 3. Change the form's ACTION to point to your Form Mail CGI-Script --> <!-- STEP ONE: Copy this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin function noEntry() { mt=document.form.entry.value; if ((mt.length<1)||(mt.substring(0,6)=="******")) { alert("I'm sorry. This entry must be " +"completed before I can submit this form" +" for processing."); document.form.entry.value="******Please Complete This Entry"; document.form.entry.focus(); return false; } else { return true; } } // End --> </SCRIPT> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <form name="form" action="/cgi-bin/your-form-processor.pl" onsubmit="return noEntry()"> <center> <input type="text" name="entry" size=40><br> <input type="submit" name="button" value="submit"> </center> </form> <!-- STEP THREE: Change the form's ACTION "javascript:if(confirm('http://javascript.internet.com/forms/to \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found. \n\nDo you want to open it from the server?'))window.location='http://javascript.internet.com/forms/to'" /forms/to" point to your Form Mail CGI-Script --> <p><center> <font face="arial, helvetica" size="-2">Free JavaScripts provided<br> by <a href="javascript:if(confirm('http://javascriptsource.com/ \n\nYou must be connected to the Internet to access this link. \n\nDo you want to open it from the server?'))window.location='http://javascriptsource.com/'" tppabs="http://javascriptsource.com/">JavaScript Source Code 3000</a></font> </center><p> <!-- Script Size: 1.00 KB -->