Entry
How can I get the field type at a position (x,y) ?
May 12th, 2001 18:30
Colin Fraser, sharon,
I suspect what you are asking is essentially impossible, if not just
highly unlikely. In a client-side script how can you establish what is
where? Obviously, by using an event, like the onMouseMove, to determine
the current position of the pointer. The problem then becomes how can
you induce the user to move the pointer to the required position.
Secondly, you will probably need to replicate your definition script for
every resolution there is. The position of a field on a form should not
vary according to the user's resolution, but you cannot guarrantee
this.
I suspect you are asking too much from JavaScript, however, if you were
to use Java, you could probably avoid trying to find the x,y position
alltogether.
The real problem with this question is its vagueness though. Are you
sure you are asking the right question? Is it possible you might be
looking for the tab-order of a set of form fields?
The part of the question that reads "field type" is odd though. Are you
referring to the data type to be returned? String, integer, real,
double, single or what? I suggest you read the JavaScript User's guide,
a link to it can be found in the main page of JavaScript FAQTS, for this
answer.