Discussion Locked

Catching Return in ASP pages

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am writing a form in ASP 3.0 which will has a field to enter search criteria and a button to click when the user wants to search for the results.
I would also like to run the code when the user presses the enter key. How do I catch this in ASP (VBScript) code?

5 replies

by juergen hartl

change the button to a submitt button that will cause the enter key to fire the form send event.
in the responding page depending on the submitt method (post/get) you can use request.form("Fieldname").value to retrieve the subitted entry.

by munrrob

The button is set up as a submit button and I am using "if NOT isempty(Request.Form("Ok")) then" to capture the input.
If I press the button the code works, if I press enter the form clears.

This discussion is closed to new replies.