![]() |
|
![]() | ||
|
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! |
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
There are no comments at this time. |
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 Home - Answers FAQ - Terms of Service - Privacy Policy |