Hi Folks,
i'm newbie at JS; but "learning by tweaking" is my middle name!
Trying to set up a link partnership application on a client's site; got this
script at "The Javascript Source", but it does not work for me.
If anyone would be so kind as to comb it for apparent flaws, I would be
greatly indebted!
My <form> statement includes the following:... onSubmit="retur n
checkFields();"
=============== ==BEGIN SCRIPT========= =====
<SCRIPT language="JavaS cript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function checkFields() {
missinginfo = "";
if (document.form1 .name.value == "") {
missinginfo += "\n - Name";
}
if (document.form1 .website.value == "") {
missinginfo += "\n - Website Name";
}
if (document.form1 .links_URL.valu e == "") {
missinginfo += "\n - URL of your LINKS PAGE";
}
if ((document.form 1.URL.value == "") ||
(document.form1 .URL.value.inde xOf("http://") == -1) ||
(document.form1 .URL.value.inde xOf(".") == -1)) {
missinginfo += "\n - URL of your Web site";
}
if ((document.form 1.links_URL.val ue == "") ||
(document.form1 .links_URL.valu e.indexOf("http ://") == -1) ||
(document.form1 .links_URL.valu e.indexOf(".") == -1)) {
missinginfo += "\n - URL of your LINKS PAGE";
}
if(document.for m1.Description. value == "") {
missinginfo += "\n - Description of your Site";
}
if ((document.form 1.email.value == "") ||
(document.form1 .email.value.in dexOf('@') == -1) ||
(document.form1 .email.value.in dexOf('.') == -1)) {
missinginfo += "\n - Email Address";
}
if (missinginfo != "") {
missinginfo ="_____________ _______________ _\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n____________ _______________ __" +
"\nPlease re-enter and submit again!";
alert(missingin fo);
return false;
}
else return true;
}
// End -->
</script>
=============== =======END SCRIPT========= ==========