Form Processed

Hi All,

I am trying to develope a web based application and I have also done some works on the current project. I am facing a problem which is I am not able to fix it.

The problem is I have a form which has one Input box and two select(dropdown box). Actually I am using to get a parameter from it and pass to agent through java script.

there is also a search button on which I use to get data from it and call an agent to set the viewselection formula on run time.

Now After putting data into Input box when I clicked on search button its running good. but when after putting data into input box and then press enter it dispaly “Form Processed” instead of triggring search button clikc event.

Is there any way so that once user press enter key then it fires click event of search button.

These button and boxes are alos used in some pages.

Please help me.

With Regards,

Vikas K Sinha

Subject: Form Processed

In the onKeyPress event of the form you are working with, use:

if (event.keyCode == 13) {

document.getElementById("searchButton").click();

return false;

}

Ensure that your search button has an id of “searchButton”.

What this code does is to check the ascii code of each key that your press. If it’s not ascii(13), then no action is taken, and the key is passed down to the browser. If it is, then your button is clicked. The return false ensures that the 13 code is not passed to the browser.

HTH

(This is Internet Explorer only; the Firefox event handler model is somewhat different as far as I recall, but Googling for info will get you lots on this)

Subject: RE: Form Processed

Thanks Simon,

Now its working fine. I am very-2 thankful to you

With Regards,

Vikas K Sinha

Subject: Form Processed

What I normally do is use Javascript to monitor key presses. When I detect that the user has hit the Enter key, I get a handle on the button and call its click method.

Subject: RE: Form Processed

Thanks Simon,

I am very thankful for your quick response, but please could you provide me some code how to get the buttons click method.

With Regards,

Vikas K Sinha