A
Axel Foley
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="return
checkFields();"
=================BEGIN SCRIPT==============
<SCRIPT language="JavaScript">
<!-- 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.value == "") {
missinginfo += "\n - URL of your LINKS PAGE";
}
if ((document.form1.URL.value == "") ||
(document.form1.URL.value.indexOf("http://") == -1) ||
(document.form1.URL.value.indexOf(".") == -1)) {
missinginfo += "\n - URL of your Web site";
}
if ((document.form1.links_URL.value == "") ||
(document.form1.links_URL.value.indexOf("http://") == -1) ||
(document.form1.links_URL.value.indexOf(".") == -1)) {
missinginfo += "\n - URL of your LINKS PAGE";
}
if(document.form1.Description.value == "") {
missinginfo += "\n - Description of your Site";
}
if ((document.form1.email.value == "") ||
(document.form1.email.value.indexOf('@') == -1) ||
(document.form1.email.value.indexOf('.') == -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(missinginfo);
return false;
}
else return true;
}
// End -->
</script>
======================END SCRIPT===================
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="return
checkFields();"
=================BEGIN SCRIPT==============
<SCRIPT language="JavaScript">
<!-- 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.value == "") {
missinginfo += "\n - URL of your LINKS PAGE";
}
if ((document.form1.URL.value == "") ||
(document.form1.URL.value.indexOf("http://") == -1) ||
(document.form1.URL.value.indexOf(".") == -1)) {
missinginfo += "\n - URL of your Web site";
}
if ((document.form1.links_URL.value == "") ||
(document.form1.links_URL.value.indexOf("http://") == -1) ||
(document.form1.links_URL.value.indexOf(".") == -1)) {
missinginfo += "\n - URL of your LINKS PAGE";
}
if(document.form1.Description.value == "") {
missinginfo += "\n - Description of your Site";
}
if ((document.form1.email.value == "") ||
(document.form1.email.value.indexOf('@') == -1) ||
(document.form1.email.value.indexOf('.') == -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(missinginfo);
return false;
}
else return true;
}
// End -->
</script>
======================END SCRIPT===================