Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] onFocus getting error.
- From: javascript@xxxxxxxxxx (Cutter (JavaScript))
- Subject: [Javascript] onFocus getting error.
- Date: Tue, 28 Jan 2003 11:25:48 -0500
Oh Yeah, and wouldn't it be "current.select();"? Cutter Peter Brunone wrote: > Craig, > > I see two definite problems here; there may be others, but this is > just off the top of my head. > > 1) There is no need for the javascript pseudoprotocol. This is only > necessary when you're calling a function from a link. The correct > syntax would be onFocus="gotMe(this, 6);" > > 2) As far as I know, there is no input type called textarea. There > is an input type text, and a textarea object (which I don't believe > has a maxlength property). > > Which line is 112? If you still have problems, knowing exactly > where the error is being thrown will help tremendously. > > Cheers, > > Peter > > > -----Original Message----- > *From:* javascript-admin@xxxxxxxxxx > [mailto:javascript-admin@xxxxxxxxxx]*On Behalf Of *Craig Gardner > *Sent:* Monday, January 27, 2003 1:16 PM > *To:* javascript@xxxxxxxxxx > *Subject:* [Javascript] onFocus getting error. > > Here's the function call: > ---function call --- > <input type='textarea' onFocus='javascript:gotMe(this, 6);'> > > Here's the function: > --- function code --- > function gotMe(current, length) > { > current.maxLength = length; > current.select; > } > > The error that I'm getting says that there's an error on the > function call line: > --- error message --- > Line: 112 > Char: 1 > Error: Object expected > Code: 0 > > Does anyone have any ideas? The only way that I've found that > fixes this problem is getting rid of the onFocus part. Even > commenting the entire function body doesn't fix it. >
- References:
- [Javascript] onFocus getting error.
- From: Peter Brunone
- [Javascript] onFocus getting error.
- Prev by Date: [Javascript] Selektiflah dalam Berbisnis
- Next by Date: [Javascript] FORM validation question
- Previous by thread: [Javascript] onFocus getting error.
- Next by thread: [Javascript] onFocus getting error.
- Index(es):