Skip to Content
author's profile photo Former Member
Former Member

How to submit the page on hitting the enter key

Hi,

Can anyone please suggest how should I go about solving the problem below.

I have created a bsp page on which i want to present data in the table view when i hit ENTER KEY.

I also have the enter button present on the page and i have aded the functionality to it as mentioned above.

Can i have the same event as that of enter button triggered when i hit the enter key.

Thanks for the help in advence

Nikhil

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 05, 2004 at 01:55 PM

    Could you be a bit more specific?

    What I understand is that you have a page with a table view and a button.

    You want the user to be able to hit the physical "ENTER KEY" on the keyboard or click the BUTTON with the mouse and have the same thing happen?

    Do I have the right?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      What all do you have on the page? Just the htmlb:tableView and htmlb:button ?

      Here is some Javascript you can try, I'm at home now and don't have the Mini WebAS Installed on this PC anymore. So you'll have to try the code and see if it works. Tomorrow morning I will go into our WebAS Development system and see what I can get out of the PAGE event of the BSP itself.

      You'll need to modify the JavaScript code here to match your form name.

      document.onkeydown=function(){
      if(event.keyCode==13 && lastObj) {  
       document.forms.myform.submit()
      }
      };
      

      However, and I wish I had the Mini WebAS still installed here at home you should really look at the htmlb:page and htmlb:form tags I'm pretty sure if you assign the method parameter and the action parameter to the htmlb:form then if the user hits enter on the page you can trap it similiar to the JavaScript. You know if I get motivated I might just try to install the Mini WebAS and play around a bit tonight. I'll post more tonight if I can and if not then tomorrow morning unless Brian or someone else beats me too it.

  • Posted on Aug 05, 2004 at 07:42 PM

    It was not even three weeks ago that this thread passed through this forum:

    htmlbsubmitonenter-at-inputfield

    Part of the responsibility that comes with asking questions here, is to also read backposts, and later when you feel up to speed, to answer a few.

    If the thread above is not yet on the mark, we can try again on a second round.

    ++bcm

    Add comment
    10|10000 characters needed characters exceeded