In my test textbox, I have the following code:
onkeyup="help_function(event,name); this.select()"
where name is the name of the text box and the JavaScript function is named help_function()
In the JavaScript file, I have the following code:
Expand|Select|Wrap|Line Numbers
- var unicode = e.keyCode? e.keyCode : e.charCode
- if(unicode == 113)
- {
- //113 is the F2 key
- if(name=="sku")
- {
- . . . code for help goes here . . .
- }
- }
1. I would like to replace the second if statement in the JavaScript code with a select statement. I probably have a typo with this logic and this is not that important since I only have 5 textboxes.
2. When the user types in one character in this test textbox, the entire field is selected and only one character can be entered. For what it's worth, I do have the following code in my HTML document:
<body onLoad = "document.form1.sku.focus()">
The sku textbox is my test textbox.
If you need any additional information, please let me know. I am not a beginner but not an expert at JavaScript so you may have to explain some things in depth.
Thanks for your time.