HighDots Forums  

focus feststellen

Javascript (German) Programmiersprache JavaScript. (de.comp.lang.javascript)


Discuss focus feststellen in the Javascript (German) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
horst lorenz
 
Posts: n/a

Default focus feststellen - 01-13-2008 , 12:54 PM






Hi, kann man abfragen, welches Input-Feld in einem Formular zur Zeit
den Focus hat? Danke Horst.

Reply With Quote
  #2  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: focus feststellen - 01-13-2008 , 01:12 PM






horst lorenz wrote:
Quote:
Hi, kann man abfragen, welches Input-Feld in einem Formular zur Zeit
den Focus hat? [...]
Nein, aber man kann bei Fokuserhalt den Elementnamen oder die Element-ID in
einer Variable oder Eigenschaft speichern und den Wert bei Bedarf auslesen.

Wofür brauchst Du das?


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee


Reply With Quote
  #3  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: focus feststellen - 01-13-2008 , 01:18 PM



Thomas 'PointedEars' Lahn wrote:
Quote:
horst lorenz wrote:
Hi, kann man abfragen, welches Input-Feld in einem Formular zur Zeit
den Focus hat? [...]

Nein, aber man kann bei Fokuserhalt den Elementnamen oder die Element-ID in
einer Variable oder Eigenschaft speichern und den Wert bei Bedarf auslesen.
Noch besser speichert man aber die Objektreferenz:

<script type="text/javascript">
var focused = null;
</script>

<... onfocus="focused = this;">


PointedEars
--
Quote:
HTML ist keine Programmiersprache!!!11111
Wie getzt, immer noch nicht?????³ Wird's da nicht langsam mal Zeit?
repeat tablecells
until Steffi yells (Jygn zu mir in dag° <ai5oel.3vvi1fr.1 (AT) klingforth (DOT) de>)


Reply With Quote
  #4  
Old   
horst lorenz
 
Posts: n/a

Default Re: focus feststellen - 01-14-2008 , 12:45 PM



On 13 Jan., 20:18, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de>
wrote:
Quote:
Thomas 'PointedEars' Lahn wrote:
Hi Thomas,

in mehreren Inputfelder werden Zahlen eingegeben, und aus diesen
Zahlen sollten neue Werte berechnet werden. Da wäre es hilfreich zu
wissen, welches Feld gerade aktiv ist.

Quote:
Noch besser speichert man aber die Objektreferenz:

* <script type="text/javascript"
* * var focused = null;
* </script

* <... onfocus="focused = this;"
Das ist ein guter Tipp, das hilft weiter, danke. Tschüß Horst.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.