CommView
asked on
How to make [ENTER] act as [TAB] in Notes Client
In the Notes client I want to goto the next field on the document using the [Enter] key, instead of the [Tab] key.
Does anybody know how to do this using standard Notes functionality or Javascript within the Notes client?
Thanks,
Wiebe van Bruggen
Does anybody know how to do this using standard Notes functionality or Javascript within the Notes client?
Thanks,
Wiebe van Bruggen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi Wiebe!
Depending on the field types, form lay-out etc: perhaps using one huge multi-value field.... newline separated.
At save or close you could distribute the separate entries over the required fields. Works best in one column of text-like fields!
CU
Ralph
Depending on the field types, form lay-out etc: perhaps using one huge multi-value field.... newline separated.
At save or close you could distribute the separate entries over the required fields. Works best in one column of text-like fields!
CU
Ralph
ASKER
Arun, Crak,
I'm very sorry to say this, but neither comment will ever win the beauty contest. As for now I will not reward either one with the point. I will leave the question open for now.
Maybe in the future I will increase the points.
I'm very sorry to say this, but neither comment will ever win the beauty contest. As for now I will not reward either one with the point. I will leave the question open for now.
Maybe in the future I will increase the points.
ASKER
I've implemented Arun's suggestion in a test situation. None of the users was satisfied with it. In other words, they all disaproved it.
You could put some JavaScript in the OnKeyPress event for each field. Then when the key code is 13 (ENTER key) just switch the focus to the field desired. You would have to do this on every field, but that will work. I did that to disable the ENTER key on a form I had to create. If it's on the web though, you'll have to make sure you write code that will handle both Netscape and IE.
ASKER
Dave,
I've heard somebody say that this shouldn't work. I'm not a JavaScript wizard, so if you want to do me a favor, could you please post the necessary code up-here?
Regards.
I've heard somebody say that this shouldn't work. I'm not a JavaScript wizard, so if you want to do me a favor, could you please post the necessary code up-here?
Regards.
OK Wiebe,
here comes the JavaScript code,
basicaly it comes from JoergReck and is posted in SandBox here:
http://www.notes.net/sandbox.nsf/85d5b6903071400e8525676d0079b3ae/51dd7eabc150ff9b88256aca00574632?OpenDocument
But the extention to step trough fields is from me, so give me the points <|;-)
Here how it works:
1.) Like Arun proposed, you have to start a timer event; not NotesTimer but JavaScript event timer. You place it into onLoad event of the form; like here:
activ = window.setInterval("myaler t()",1);
2.) At removing of the form you stop the event handler in onUnload event, like here:
window.clearInterval(activ );
3.) So, all you now need is this Interval handler to check the fields for the enter key code. You place the code into JSHeader section. Here it comes:
var newline = String.fromCharCode(10);
var activ;
var fname = new Array( "myFieldA", "myFieldA_1", "myFieldA_2", "myFieldA_3", "myFieldA_4");
var fnum = 0;
var fcount = fname.length - 1;
function myalert() {
if (document.forms[0][fname[f num]].valu e.indexOf( newline)>= 0) {
document.forms[0][fname[fn um]].value = document.forms[0][fname[fn um]].value .replace(S tring.from CharCode(1 0), '');
fnum = (fnum >= fcount) ? 0 : (fnum + 1);
document.forms[0][fname[fn um]].focus ();
}
}
In the fname array you define the field names you like to check and to step trough.
This code works, but even it is comming from me I do not recomand you to use it for your users. It is only for demostration that it works. The final question is still wether this all makes sense.
(In any cases give me the points, 'cose your question is answered now <|;-)
Regards,
zvonko
here comes the JavaScript code,
basicaly it comes from JoergReck and is posted in SandBox here:
http://www.notes.net/sandbox.nsf/85d5b6903071400e8525676d0079b3ae/51dd7eabc150ff9b88256aca00574632?OpenDocument
But the extention to step trough fields is from me, so give me the points <|;-)
Here how it works:
1.) Like Arun proposed, you have to start a timer event; not NotesTimer but JavaScript event timer. You place it into onLoad event of the form; like here:
activ = window.setInterval("myaler
2.) At removing of the form you stop the event handler in onUnload event, like here:
window.clearInterval(activ
3.) So, all you now need is this Interval handler to check the fields for the enter key code. You place the code into JSHeader section. Here it comes:
var newline = String.fromCharCode(10);
var activ;
var fname = new Array( "myFieldA", "myFieldA_1", "myFieldA_2", "myFieldA_3", "myFieldA_4");
var fnum = 0;
var fcount = fname.length - 1;
function myalert() {
if (document.forms[0][fname[f
document.forms[0][fname[fn
fnum = (fnum >= fcount) ? 0 : (fnum + 1);
document.forms[0][fname[fn
}
}
In the fname array you define the field names you like to check and to step trough.
This code works, but even it is comming from me I do not recomand you to use it for your users. It is only for demostration that it works. The final question is still wether this all makes sense.
(In any cases give me the points, 'cose your question is answered now <|;-)
Regards,
zvonko
ASKER
zvonko,
I'm looking into it.
thanks!
I'm looking into it.
thanks!
Hello CommView,
remember this?
remember this?
ASKER
Yes, I do.
Is not satisfactory at all. Keystrokes keep being missed by any routine. It seems there is no solution.
I'm sorry. I hope someone will pop up with a working solution, but I don't have high hopes.
Thanks anyway for the suggestions.
Is not satisfactory at all. Keystrokes keep being missed by any routine. It seems there is no solution.
I'm sorry. I hope someone will pop up with a working solution, but I don't have high hopes.
Thanks anyway for the suggestions.
what do you meen by saying: keystroke are missed?
doese the cursor advance at pressing [ENTER] from the actual field to the next field in your predefined list of fields?
doese the cursor advance at pressing [ENTER] from the actual field to the next field in your predefined list of fields?
Wiebe, are you still out there?
How have you been doing lately?
Ralph
How have you been doing lately?
Ralph
ASKER
Yep, i'm still out here, but not much on EE anymore (time 'problem')
Please, contact me directly on wiebe.van.bruggen@changeto comm.nl
Please, contact me directly on wiebe.van.bruggen@changeto
CommView,
No comment has been added lately (215 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
RECOMMENDATION: Award points to Arunkumar http:#6349139
Please leave any comments here within 4 days.
-- Please DO NOT accept this comment as an answer ! --
Thanks,
Zvonko
EE Cleanup Volunteer
No comment has been added lately (215 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
RECOMMENDATION: Award points to Arunkumar http:#6349139
Please leave any comments here within 4 days.
-- Please DO NOT accept this comment as an answer ! --
Thanks,
Zvonko
EE Cleanup Volunteer
Wiebe, what's up? How's life? Is your company still standing?
If you still have my mail address: change "wanadoo" into "zonnet"!
If you still have my mail address: change "wanadoo" into "zonnet"!
I hope also Wiebe is looking for this.
Hello CRAK.
Hello CRAK.
Hi Zvo! I'll be back cleaning up again shortly!
That would be good.
ASKER