Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16170 > unrolled thread

dear DOM

Started byjustaguy <lichunshen84@gmail.com>
First post2012-09-26 19:49 -0700
Last post2012-09-27 11:08 -0700
Articles 4 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  dear DOM justaguy <lichunshen84@gmail.com> - 2012-09-26 19:49 -0700
    Re: dear DOM Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-09-27 10:00 +0200
      Re: dear DOM Christoph Becker <cmbecker69@gmx.de> - 2012-09-27 19:21 +0200
        Re: dear DOM justaguy <lichunshen84@gmail.com> - 2012-09-27 11:08 -0700

#16170 — dear DOM

Fromjustaguy <lichunshen84@gmail.com>
Date2012-09-26 19:49 -0700
Subjectdear DOM
Message-ID<275034d9-e564-4088-95a8-25de1c8c84c3@e14g2000yqm.googlegroups.com>
HTML code:
<input type="text" id="field1">

<select id="mySel">
</select>

js code: function X
... that would populate the mySel element based on the value/input of
field1

Question, how could we trigger the js function X right upon data/value
input of field1 without manually clicking on event trigger/handler?  I
know I don't know enough of DOM...
Ideally achieve it without resorting to HTML5.

Thanks.

[toc] | [next] | [standalone]


#16176

FromErwin Moller <erwinmollerusenet@xs4all.nl>
Date2012-09-27 10:00 +0200
Message-ID<506407a0$0$6842$e4fe514c@news2.news.xs4all.nl>
In reply to#16170
On 9/27/2012 4:49 AM, justaguy wrote:
>
> HTML code:
> <input type="text" id="field1">
>
> <select id="mySel">
> </select>
>
> js code: function X
> ... that would populate the mySel element based on the value/input of
> field1
>
> Question, how could we trigger the js function X right upon data/value
> input of field1 without manually clicking on event trigger/handler?  I
> know I don't know enough of DOM...
> Ideally achieve it without resorting to HTML5.
>
> Thanks.
>

I don't see how that can be possible.
How can your script know when I am done typing?
Suppose I am typing in your "field1" the following:
justaguy

How then can your script know when I am done typing?
If you use an event like KeyUp you will fill your select with:
j
ju
jus
just
etc.

So what is it you want to program?


 > I know I don't know enough of DOM...
 > Ideally achieve it without resorting to HTML5.

"resorting"?


Regards,
Erwin Moller

-- 
"That which can be asserted without evidence, can be dismissed without 
evidence."
-- Christopher Hitchens

[toc] | [prev] | [next] | [standalone]


#16195

FromChristoph Becker <cmbecker69@gmx.de>
Date2012-09-27 19:21 +0200
Message-ID<k421u4$8mq$1@speranza.aioe.org>
In reply to#16176
Erwin Moller wrote:
> I don't see how that can be possible.
> How can your script know when I am done typing?

One /might/ use the change event of the input element.  This occurs as
soon as the input looses focus, if any changes were made.

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#16197

Fromjustaguy <lichunshen84@gmail.com>
Date2012-09-27 11:08 -0700
Message-ID<f3485ba0-15d3-4bf8-964e-03a01944a230@o7g2000yqb.googlegroups.com>
In reply to#16195
On Sep 27, 1:21 pm, Christoph Becker <cmbecke...@gmx.de> wrote:
> Erwin Moller wrote:
> > I don't see how that can be possible.
> > How can your script know when I am done typing?
>
> One /might/ use the change event of the input element.  This occurs as
> soon as the input looses focus, if any changes were made.
>
> --
> Christoph M. Becker

I haven't thought of this event handler at the first field.  You're a
genius.  Thank you.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web