Google Answers Logo
View Question
 
Q: Frontpage/Javascript usage problem ( No Answer,   0 Comments )
Question  
Subject: Frontpage/Javascript usage problem
Category: Computers > Internet
Asked by: englisymary-ga
List Price: $2.00
Posted: 28 Dec 2004 07:53 PST
Expires: 27 Jan 2005 07:53 PST
Question ID: 448187
Hello. I have a form that I inherited and assume was generated by
FrontPage. I am trying to add a call to a javascript function to check
that a user has filled in the required fields. The javascript function
works fine on other forms. FP removed the call to my function when I
put it in the onSubmit clause. I was tring to replace:
onSubmit="return FrontPage_Form1_Validator(this)"
with
onSubmit="return checkrequired(this)"

Looking at an answer previously posted here
(http://answers.google.com/answers/threadview?id=214965), I put my
call in the OnClick clause. Now my function get called but the
parameter is not recognised in my function. My function is:
function checkrequired(which) {
var pass=true;
if (document.images) {
    alert("At this point, which.length is " + which.length);
    for (i=0;i<which.length;i++) {
        var tempobj=which.elements[i];
        if (tempobj.name.substring(0,8)=="required") {
            if (((tempobj.type=="text"||tempobj.type=="textarea")&&
              tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
              tempobj.selectedIndex==0)) {
                pass=false;
                break;
         }
      }
   }
}
if (!pass) {
    shortFieldName=tempobj.name.substring(8,30).toUpperCase();
    alert("We cannot process your request without the necessary
information.  Please make sure that your "+shortFieldName+"
information was properly entered.");
return false;
}
else
return true;
}

Can anyone tell me what I am doing wrong? Thanks!
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy