[Javascript] looking for HACK for events

Walter Torres walter at torres.ws
Wed Oct 8 12:27:52 CDT 2003


> -----Original Message-----
> From: javascript-bounces at LaTech.edu
> [mailto:javascript-bounces at LaTech.edu]On Behalf Of Chris Tifer
> Sent: Wednesday, October 08, 2003 11:22 AM
> To: [JavaScript List]
> Subject: Re: [Javascript] looking for HACK for events
>
>
> Am you overlooking the obvious answer of functions?  Could you
> explain a little more what you're asking for as it seems so
> simple and I know you've come up with some more complex stuff
> in the past that this can't be stumping you.

OK, I hope I can explain well enough...

I have a method that attaches a status bar to a TEXT, PASSWORD and TEXTAREA
Form Elements. When you enter characters, the bar advances.

When custom attributes are added to these types of Form elements, my method
attaches itself to these Elements via Key Events. Other Forms Elements of
the same kind are ignored. So you can choose which uses the bar by these
custom attributes.

All works (just sorting out CSS display issues on Mozilla, but that's a
different issue).

I have another method that makes a TEXTAREA Form Element behave as the
PASSWORD element does.

Also attaches itself to the Element via Key Events. Same as the status bar
method, it looks for a custom attribute, if not there, it is not attached.

The idea of the custom attributes is that a web designer (who does not know,
does not want to know JS coding) can use these features without opening the
code. Sort of a black box, if you will.

Now, separately, these work fine.

But if I place them on the same page, which ever is loaded first does not
fire.

The second is overriding the Key Event attachment.

My goal is to have some way of having these work together, but not coded
together.

I would like to do this...

    <script src='./TextArea_status-bar.js'></script>
    <script src='./TextArea_password.js'></script>

And all would be right with the world.

I guess I'm looking for some way to "register" multiple methods to the same
event. Even if it means I need a new method as a per cursor to all this.

Thanks for your ideas.

Walter





More information about the Javascript mailing list