Начало
Формы
Только Одна Область
Посетитель должен заполнить или одну из двух областей, их имени или адрес электронной почты.
Please enter your name or your email address.
Name
Email
Or...
JavaScript Forms: Только Одна Область
<!-- TWO STEPS TO INSTALL ONLY ONE FIELD: 1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin function checkFields() { name = document.submitform.name.value; email = document.submitform.email.value; if ((name == "") && (email == "") ) { alert("Please enter your name or your email address."); return false; } else return true; } // End --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <center> <form action="http://javascripts-do.narod.ru" name=submitform onSubmit="return checkFields()"> Please enter your name or your email address.<br><br> <table border=0> <tr> <td align=center>Name</td> <td> </td> <td align=center>Email</td> </tr> <tr> <td align=center><input type=text name=name value="" onFocus="document.submitform.email.value='';" size=10></td> <td align=center>Or...</td> <td align=center><input type=text name=email value="" onFocus="document.submitform.name.value='';" size=10></td> </tr> <tr> <td colspan=3 align=center><input type=submit value="Submit!"></td> </tr> </table> </form> </center> <!-- Script Size: 1.45 KB -->