I couldn’t find an appropriate solution to my problem so far, although I found some postings with similar questions.
This is my question:
What are the requirements to be able to submit a (search) form hitting the Enter-key ?
or:
What’s not allowed on a form to be able to submit it with the enter-key ?
I have a web search form with 6 text input fields, 7 dropdown fields, and one checkbox field where the search criteria can be entered or selected. There are also two buttons (submit and reset), a $$Return - field, some hidden fields, and a lot of Pass-thru HTML. There is no RT field.
The form property ‘Generate HTML for all fields’ is checked.
At the moment the search query can be started only by pressing the Submit-Button which starts the search via @URLOpen.
However I want to be able to start the search also via the enter-key.
The $$Return-field contains all the code necessary to start the search. But nothing happens when I hit Enter.
Are there too many fields on the search form ? …
Please, can somebody give me a hint ?
Thanks in advance.
mhf
Subject: Submit a web search form with Enter-key
I think the answer depends largely on the browser.
Some non-Notes specific information that might give you a background to the problem:
http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html
HTH - Rufus.
Subject: Your link gave me an answer …
Thank you for this link. I found an answer to my problem there - it’s the fact that I have more than one text input field in my form. After I continued my research yesterday I was assuming something like that myself.Now I will try if nevertheless the other advice can help me getting round this fact …
mhf
Subject: Submit a web search form with Enter-key
The browser needs an html form with either a submit button, i.e. or a image button, i.e. .
Hitting return when you have focus on an element in the form will cause the submit to happen unless there is a password field.
If you use a image button you will also have to put fields on your domino form called “x” and “y”. This is because image button will send the x and y coords of the mouse click in the image if it is clicked. You don’t need that info , but Domino will throw an error if you post fields to it that don’t match what is on it’s form.
Look at what Domino is generating for you and play about with it. Also try writing some simple html examples and seeing what the browser does with it.
kerr
Subject: Thank you - that’s the solution
Thank you very much. I replaced the notes-button (type=“button”) with Pass-thru HTML defining a submit-button. Now either by clicking the button or hitting the enter-key the code in $$Return is executed.
mhf
Subject: Submit a web search form with Enter-key
This should work: Go to the properties of the button you want to use “Enter” with. First tab (Button Info) at the bottom is “Type”. Make sure Default is checked.
Here is the text from Lotus Help:
“(If Default is checked and…) If the user presses the Enter key when the focus is not on a button, this is the default button that is pressed instead. Note you can have only one default button”. Hope that helps - Cheers.
Subject: Doesn’t work in my application …
Thanks for you answer but this feature doesn’t work in my application.
mhf
Subject: Submit a web search form with Enter-key
One possible way:
Under “onKeyDown” form properties:
if (event.keyCode == 13)
{
var f = document.forms[0];
if (IsValidTextNoAlert(f.SearchString)){
parent.Right.location = “/”+ f.wdbn.value + “/AllDocsSearch?SearchView&Query=”+ f.SearchString.value;
}
return false;
}
where “wdbn” is a field with @WebDbName, “Right” is the frame for the search results to open, SearchString is the the search field.
Similar code should be under “Search” or “Go” button.
HTH,
Simeon
Subject: Thanks for your time, …
but I already found another solution (see other posted answers) which seems to be a bit easier.
mhf