You're calling the function with an argument, but the function definition
has no argument.  The argument is "this" which is an object (the form),
so the call triggers the "object expected" error.  Either omit the
argument by using
  return validateFrom()
or add an argument to the function definition
  function validateForm(f)
If yoy go the 2nd route, use "f" rather than "document.adminchange".
-David

On Mon, 25 Sep 2000 23:32:57 GMT "Terri Stocke" <[EMAIL PROTECTED]>
writes:
> I'm deferring to the more experienced programmers on the list...
> 
> I am getting an "object expected" error with this javascript...can 
> anyone 
> point out the problem?
> 
> TIA!
> 
> [snip]
> <cfform onSubmit="return validateForm(this)" 
> action="admin_edit.cfm?classid=#classid#" name="adminchange" 
> method="POST" 
> enablecab="Yes">
> [snip]
> 
> <cfoutput>
> <script language="Javascript">
> function validateForm(){
> var registeredCount = #registered.registered_count#;
>       for (i=0;i<document.adminchange.length;i++){
>               if (left(document.adminchange.elements(i).name, 11) 
> ="status_name")
>                       if (document.adminchange.elements(i).value = 
> "1")
>                               registeredCount = registeredCount + 
> 1;
>                               }
>       if (registeredCount > #classname.class_size#){
>               alert('The maximum class size is " & 
> #classname.class_size# & "."');
>               return false;
>               }
>       return true;
>       }
>       </script>
>       </cfoutput>
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to