Metachecker.net
|
TrafficChecker.net
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Form-Check
[View Sample]
The small script checks if all your form elements are filled in. If not the submit-button will not be displayed. Netscape-Users will see an empty button until the form is complete.
Insert into <HEAD>
<script> <!-- Beginning of JavaScript - // CREDITS: // Dirty Form-Check // by Urs Dudli and Peter Gehrig // Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved. // Permission given to use the script provided that this notice remains as is. // Additional scripts can be found at http://www.24fun.ch. // info@24fun.ch // 2/29/2000 // IMPORTANT: // If you add this script to a script-library or script-archive // you have to add a link to http://www.24fun.ch on the webpage // where this script will be running. var iscomplete=false function checkform() { iscomplete=true for (i=0;i<=document.myform.elements.length-1;i++) { if (document.myform.lastname.value=="") {iscomplete=false} if (document.myform.firstname.value=="") {iscomplete=false} if (document.myform.adress.value=="") {iscomplete=false} if (document.myform.zip.value=="") {iscomplete=false} if (document.myform.city.value=="") {iscomplete=false} if (document.myform.country.value=="") {iscomplete=false} if (document.myform.email.value=="") {iscomplete=false} } if (!iscomplete) { window.status="Please fill in all form fields. Thank you!" if (document.all) { submitbutton.style.visibility="HIDDEN" iscomplete=false } if (document.layers) { document.myform.submitbut.value="NOT YET" iscomplete=false } } if (iscomplete) { window.status="Great! Now you can submit the form!" if (document.all) { submitbutton.style.visibility="VISIBLE" iscomplete=true } if (document.layers) { document.myform.submitbut.value="NOW" iscomplete=true } } var timer= setTimeout("checkform()",200) } function oksubmit() { return iscomplete } // - End of JavaScript - --> </script>
Insert into <BODY>
<body bgcolor="#FFFFFF" onLoad="checkform()"> <form NAME="myform" onSubmit="return oksubmit()" ACTION="mailto:isnotareal@emailadress.org" METHOD="POST"> <center> <table BORDER="0" CELLSPACING="0" CELLPADDING="1"> <tr valign="top"> <td bgcolor="CCCCCC"> <font SIZE="1" face="Verdana">Name:</font></td> <td bgcolor="CCCCCC" align="right"><font SIZE="1" face="Verdana"><input NAME="lastname" TYPE="Text" SIZE="30" MAXLENGTH="50"> </td> </tr> <tr valign="top"> <td bgcolor="CCCCCC"> <font SIZE="1" face="Verdana">First Name:</font></td> <td bgcolor="CCCCCC"><font SIZE="1" face="Verdana"><input NAME="firstname" TYPE="Text" SIZE="30" MAXLENGTH="50"> </td> </tr> <tr valign="top"> <td bgcolor="CCCCCC"> <font SIZE="1" face="Verdana">Adress:</font></td> <td bgcolor="CCCCCC" align="right"><font SIZE="1" face="Verdana"><input NAME="adress" TYPE="Text" SIZE="30" MAXLENGTH="50"> </td> </tr> <tr valign="top"> <td bgcolor="CCCCCC"> <font SIZE="1" face="Verdana">ZIP/City/Country:</font></td> <td bgcolor="CCCCCC"><table BORDER="0" CELLSPACING="0" CELLPADDING="0" width="100%"> <tr> <td bgcolor="CCCCCC"><font SIZE="1" face="Verdana"><input NAME="zip" TYPE="Text" SIZE="4" MAXLENGTH="4"></td> <td bgcolor="CCCCCC" align="middle"><font SIZE="1" face="Verdana"><input NAME="city" TYPE="Text" SIZE="15" MAXLENGTH="50"></td> <td bgcolor="CCCCCC" align="right"><font SIZE="1" face="Verdana"><input NAME="country" TYPE="Text" SIZE="4" MAXLENGTH="4"> </td> </tr> </table> </td> </tr> <tr valign="top"> <td bgcolor="CCCCCC"> <font SIZE="1" face="Verdana">Email:</font></td> <td bgcolor="CCCCCC" align="right"><font SIZE="1" face="Verdana"><input NAME="email" TYPE="Text" SIZE="30" MAXLENGTH="50"> </td> </tr> <td height="5" bgcolor="CCCCCC" colspan="2"></td> </tr> </table> </center> <div align="center" id="submitbutton" style="visibility:hidden"> <center> <table BORDER="0" CELLSPACING="0" CELLPADDING="0"> <tr valign="top"> <td align=middle><font SIZE="1" face="Verdana"><input NAME="submitbut" TYPE="submit" VALUE=" submit "></td> </tr> <tr> </table> </center> </div> </form>
Other Options