[Project_owners] how to get current value of a field entered by user?

Eric Jung grimholtz at yahoo.com
Sun Sep 4 08:58:31 EDT 2005



--- Michael Vincent <mv_van_rantwijk at yahoo.com> wrote:

> Eric Jung wrote:
> > Hi,
> > I think I asked this or a similar question before, and Neil
> answered
> > it. I couldn't find the answer in the archives, though.
> > 
> > I'm watching clicks on a page like this:
> > 
> > passwordMaker.appcontent.addEventListener("click", this.click,
> true);
> > function click(evt) {
> >   dump("type=" + target.attributes["type"].value + "\n");
> >   dump("name=" + target.attributes["name"].value + "\n");
> >   dump("value=" + target.attributes["value"].value + "\n");
> > }
> 
> Shouldn't you be using 'event' instead of 'evt'?

You can name the variable which gets passed to the function anything
you like. I use evt out of habit.

> Also, what is target? Shouldn't that be event.target or 
> event.originalTarget?

Yes, sorry, I forget to include the first line in the function:
var target = evt.target;

> 
> Michael
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Project_owners mailing list