Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: LEN not supported


Message #1 by lingasamyk@h... on Tue, 23 Apr 2002 05:39:12
> I have a ASP page that does error checking when someone input data on a 
web
page form.  Essentially it checks for input in a field using the following:

<SCRIPT LANGUAGE=vbscript>
Sub btnsubmit_OnClick()
If Len(frmAdd.PositionTitle.value)=0 Then
It works fine here in the same environment, can you send the entire code 
so that it will be easy to find out the problem

Regards,
Lingasamy K


Alert "You must enter a Position Title"
frmAdd.PositionTitle.focus
Exit Sub
ElseIf Len(frmAdd.Status.value)=0 Then
Alert "You must enter Status (ie Full Time, Part Time, etc...)"
frmAdd.Status.focus
Exit Sub....etc...

When it sees Len, it errors out and reports: "Object doesn't support
property or method. frmAdd.PositionTitle"

I have another script very similar to this one working just fine on another
site.
Why would this not work?
I am testing on W2K, IIS v5
Any ideas appreciated.
Don


Message #2 by lingasamyk@h... on Tue, 23 Apr 2002 05:39:17
It works fine here in the same environment, can you send the entire code 
so that it will be easy to find out the problem

Regards,
Lingasamy K

Message #3 by "Drew, Ron" <RDrew@B...> on Tue, 23 Apr 2002 17:49:40 -0400
Looks like you are testing the form element value on the server side.
Do not think that will work.  Change the validation to the client side
so the server only sees good stuff.  User javascript ...something like..
<script language=3D"JavaScript">
<!--
function CheckForm() {
  if (document.frmAdd.PositionTitle.value =3D=3D "")
      {
       alert("Please enter a value for the PositionTitle.");
       document.frmAdd.PositionTitle.focus();
       return (false);
      }
 return (true);
}
//-->
</script>
<FORM onSubmit=3D"return CheckForm()" METHOD=3D"post" 
ACTION=3D"xxxxx.asp"
NAME=3DfrmAdd>

-----Original Message-----
From: Don Barton [mailto:bartond57@c...]
Sent: Monday, April 22, 2002 11:26 PM
To: ASP Databases
Subject: [asp_databases] LEN not supported


I have a ASP page that does error checking when someone input data on a
web page form.  Essentially it checks for input in a field using the
following:

<SCRIPT LANGUAGE=3Dvbscript>
Sub btnsubmit_OnClick()
If Len(frmAdd.PositionTitle.value)=3D0 Then
   Alert "You must enter a Position Title"
   frmAdd.PositionTitle.focus
   Exit Sub
 ElseIf Len(frmAdd.Status.value)=3D0 Then
   Alert "You must enter Status (ie Full Time, Part Time, etc...)"
   frmAdd.Status.focus
   Exit Sub....etc...

When it sees Len, it errors out and reports: "Object doesn't support
property or method. frmAdd.PositionTitle"

I have another script very similar to this one working just fine on
another site. Why would this not work? I am testing on W2K, IIS v5 Any
ideas appreciated. Don



Message #4 by "Don Barton" <bartond57@c...> on Mon, 22 Apr 2002 21:25:47 -0600
I have a ASP page that does error checking when someone input data on a web
page form.  Essentially it checks for input in a field using the following:

<SCRIPT LANGUAGE=vbscript>
Sub btnsubmit_OnClick()
If Len(frmAdd.PositionTitle.value)=0 Then
Alert "You must enter a Position Title"
frmAdd.PositionTitle.focus
Exit Sub
ElseIf Len(frmAdd.Status.value)=0 Then
Alert "You must enter Status (ie Full Time, Part Time, etc...)"
frmAdd.Status.focus
Exit Sub....etc...

When it sees Len, it errors out and reports: "Object doesn't support
property or method. frmAdd.PositionTitle"

I have another script very similar to this one working just fine on another
site.
Why would this not work?
I am testing on W2K, IIS v5
Any ideas appreciated.
Don



  Return to Index