need an onEnter event

Results 1 to 2 of 2

Thread: need an onEnter event

  1. #1
    Join Date
    Dec 1969

    Default need an onEnter event

    I have a page that accepts either a Personell Number or Last Name for data retrieval. I have two textboxes and two buttons which call two different VBScript subs, respectively. I am trying to get the appropriate vbscript sub to run when a user enters data into one of the a textboxes and hits 'enter'. I can make one work by making a button a type=SUBMIT, but then it calls the same sub regardless of which textbox you are in. How can I make both work? If there was an onEnter event, I'd just slap that into the <input ...> tag, but there isn't. I'd use a form, but I don't want to change web pages. Help?

  2. #2
    Join Date
    Dec 1969

    Default Disable ENTER entirely?

    That one is easy. Is that sufficient for you? Now you *force* them to hit one of the two buttons.<BR><BR>Simply change *both* buttons from &#060;INPUT TYPE=SUBMIT&#062; to &#060;INPUT TYPE=BUTTON&#062; and now ENTER won&#039;t fire either one.<BR><BR>If you need them both to end up doing a submit, then just have the code that they invoke end up by doing<BR> document.YourFormName.submit( )<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts