Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current Element

Status
Not open for further replies.
May 7, 2002
2
US
First Web App, so please excuse me if this doesn't make sense. I've got an event for when the user presses a key (like enter) on several Form Fields (text entry). There are certain times I would like to make a decison on what to do based on what field they came from. Is there some way in the KeyPress event I can tell what Element they came from? I know in JavaScript the keyword Element refers to the tag that fired the event. Is their something similar in VBScript or do I have to pass the Element Name to the Client-Side Script?

For Example: onkeypress="KeyHandler"

sub KeyHandler
if window.event.keyCode = 9 then
exit sub
end if

*** Here is the Question ***

if window.event.keyCode = 13 then
if ???.name = txtDateField then
do something else
end if
end if
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top