function submitLink() { if ( ! chkField( "WebsiteTitle" ) ) { document.forms[0].WebsiteTitle.focus() alert("You must enter the title of the Website."); return; } if ( ! chkField( "WebsiteURL" ) ) { document.forms[0].WebsiteURL.focus() alert("You must enter the URL of the Website."); return; } if ( document.forms[0].WebsiteURL.value == "http://" ) { document.forms[0].WebsiteURL.focus() alert("You must enter the URL of the Website."); return; } if ( ! chkField( "ContactName" ) ) { document.forms[0].ContactName.focus() alert("You must enter a Contact Name."); return; } if ( ! chkField( "UserEmail" ) ) { document.forms[0].UserEmail.focus() alert("You must enter an Email address."); return; } if ( ! chkEmailFormat( ) ) { document.forms[0].UserEmail.focus() alert("Your email address does not appear to be correctly formed."); return; } catok = false; for( i= 0; i < document.forms[0].Category.length; i++) { if ( document.forms[0].Category[ i ].checked ) { catok = true; break; } } if ( ! catok ) { document.forms[0].Category[0].focus() alert("You must select at least one category."); return; } if ( ! chkField( "Body" ) ) { document.forms[0].Body.focus() alert("You must enter a description of the website."); return; } if ( ! chkField( "ReciprocalURL" ) ) { document.forms[0].ReciprocalURL.focus() alert("You must enter the URL where the reciprocal link has been placed."); return; } if ( document.forms[0].ReciprocalURL.value == "http://" ) { document.forms[0].ReciprocalURL.focus() alert("You must enter the URL where the reciprocal link has been placed."); return; } document.forms[0].submit() } function submitForm() { if ( ! chkField( "UserFirstName" ) ) { document.forms[0].UserFirstName.focus() alert("You must enter your First Name."); return; } if ( ! chkField( "UserLastName" ) ) { document.forms[0].UserLastName.focus() alert("You must enter your Last Name."); return; } if ( ! chkField( "UserEmail" ) ) { document.forms[0].UserEmail.focus() alert("You must enter your email address."); return; } if ( ! chkEmailFormat( ) ) { document.forms[0].UserEmail.focus() alert("Your email address does not appear to be correctly formed."); return; } if ( ! chkField( "Body" ) ) { document.forms[0].Body.focus() alert("You must enter your comments."); return; } document.forms[0].submit() } function chkField( fldName ) { var fldval = eval("document.forms[0]." + fldName + ".value"); if ( fldval == "" || fldval == null || fldval.length == 0 ) { return( false ); } var failed = true; for (i = 0; i < fldval.length; i++) { if ( fldval.charAt(i) > ' ' ) { failed = false; break; } } if ( failed ) { return(false); } return( true ) } function chkEmailFormat( ) { var ea = document.forms[0].UserEmail.value if ( ea == "" || ea == null || ea.length == 0 ) { return( false ); } if ( ea.indexOf(',') != -1 ) { return( false ); } if ( ea.indexOf(' ') != -1 ) { return( false ); } if ( ea.indexOf('@') == -1 ) { return( false ); } if ( ea.indexOf('.') == -1 ) { return( false ); } return ( true ); } function newWindow( sURL, sTitle, sWidth, sHeight) { var params = "'toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes,width=" + sWidth + ",height=" + sHeight + "'" window.open(sURL,sTitle,params) }