![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||||||
| ||||||||
|
|
Short question: Can I create a form where the user can simply hit the "1" key on the keyboard and a button click for a specific button on the form is simulated? |
|
As an exercise we had a form that had two input fields and one could press a button and the contents of the two fields would be added together. |
|
I thought it would be interesting to write an entire calcualtor (similar to the one that comes with Windows) as an HTML page. |
|
I got most of it right, I have buttons and an input field and buttons to do the calculations. |
|
What I was hoping to do as the cherry on top was to enable it for keyboard access, so a user could press the keys (1, 2, 3 etc.) to enter the values and then the calcualtion key (+, -, *, etc) without having to click on each button. |
|
I found that I could specify access keys in the HTML, but that works weird. |
|
In Firefox, it doesn't seem to work at all. |
|
In IE, if I press Alt+1, it will cycle through (and enter) either 1, 2, or 3 (the three buttons I've defined accesskey values for). |
#3
| ||||||||
| ||||||||
|
|
Scripsit MikeB: Short question: Can I create a form where the user can simply hit the "1" key on the keyboard and a button click for a specific button on the form is simulated? That's not a short question, really. And questions don't get any shorter, or any simpler, just by calling them "short". I guess we'll just have to differ. I thought that was a short question |
|
As an exercise we had a form that had two input fields and one could press a button and the contents of the two fields would be added together. Did you do it? URL? The odds are that it is far more important to analyze the basic solution than to invent new complexities. So how did the page look like when scripting was disabled? Let me guess... a form, with a button, and clicking on the button does nothing? No explanation anywhere? |
|
I thought it would be interesting to write an entire calcualtor (similar to the one that comes with Windows) as an HTML page. It would be an exercise in futility, since the calculator would be inferior even to the _simple_ (as opposite to "scientific") mode of the Windows Calculator. |
|
I got most of it right, I have buttons and an input field and buttons to do the calculations. But you didn't learn yet that the way to share your HTML document is to upload it on a web server and post the URL? |
|
What I was hoping to do as the cherry on top was to enable it for keyboard access, so a user could press the keys (1, 2, 3 etc.) to enter the values and then the calcualtion key (+, -, *, etc) without having to click on each button. You can do that, with the usual caveats, using JavaScript. That's off-topic here. There's the HTML issue of associating scripts with elements, with attributes like onkeypress, but that's really the trivial side of the matter (and the details depend on the approach). |
|
I found that I could specify access keys in the HTML, but that works weird. Indeed. So forget them. To begin with, some browsers interpret accesskeys as _activating_ a button, some just as _focusing_ on it. Accesskey attributes in HTML are widely regarded as a failure, by people who have tested the idea and analyzed the design. They are detrimental to accessibility, since they may mask out built-in access key assignments in browsers and other software. |
|
In Firefox, it doesn't seem to work at all. You did something wrong. Wrong expectations? |
|
In IE, if I press Alt+1, it will cycle through (and enter) either 1, 2, or 3 (the three buttons I've defined accesskey values for). You did something wrong. Maybe on line 42? |
#4
| ||||||
| ||||||
|
|
Short question: Can I create a form where the user can simply hit the "1" key on the keyboard and a button click for a specific button on the form is simulated? That's not a short question, really. And questions don't get any shorter, or any simpler, just by calling them "short". I guess we'll just have to differ. |
|
As I get to read about HTML, I realize there seems to be hardly any issue that is either "short" or "simple", but still, one can hope. |
|
I did it. But we don't upload our pages to a server, |
|
The instructor showed us how to register a domain name, but we've not yet begun to upload any real pages to that. |
|
But I thought, what the heck, I might try it and see if you woulod offer a useful suggestion. So here it is: http://fmechess.org/demo/calculator.html |
|
So "forgetting accesskeys" what else do I use? |
#5
| |||
| |||
|
|
Scripsit MikeB: Short question: Can I create a form where the user can simply hit the "1" key on the keyboard and a button click for a specific button on the form is simulated? That's not a short question, really. And questions don't get any shorter, or any simpler, just by calling them "short". As an exercise we had a form that had two input fields and one could press a button and the contents of the two fields would be added together. Did you do it? URL? The odds are that it is far more important to analyze the basic solution than to invent new complexities. So how did the page look like when scripting was disabled? Let me guess... a form, with a button, and clicking on the button does nothing? No explanation anywhere? I thought it would be interesting to write an entire calcualtor (similar to the one that comes with Windows) as an HTML page. It would be an exercise in futility, since the calculator would be inferior even to the _simple_ (as opposite to "scientific") mode of the Windows Calculator. |
#6
| ||||
| ||||
|
|
Scripsit MikeB: Short question: Can I create a form where the user can simply hit the "1" key on the keyboard and a button click for a specific button on the form is simulated? That's not a short question, really. And questions don't get any shorter, or any simpler, just by calling them "short". I guess we'll just have to differ. On which of my statements? If you call a 30-word question short, then we do differ, and you are wrong. If you think that a question gets shorter or simpler by calling it "short", then we do differ, and you are very wrong. |
|
As I get to read about HTML, I realize there seems to be hardly any issue that is either "short" or "simple", but still, one can hope. Most issues about HTML are both short and simple, but there's little need to _discuss_ them. I did it. But we don't upload our pages to a server, You really shouldn't ask for help in HTML authoring for the WWW in public before you know how to upload a page on a server and understand the importance of posting a URL. |
|
The instructor showed us how to register a domain name, but we've not yet begun to upload any real pages to that. A ten-year old kid can upload a real page on a free server with her left hand. Registering a domain name has nothing to do with it. |
|
But I thought, what the heck, I might try it and see if you woulod offer a useful suggestion. So here it is:http://fmechess.org/demo/calculator.html That's not what I asked for. I asked for the URL of the _basic_ exercise. So "forgetting accesskeys" what else do I use? Use the Force. And do things in the right order. First, create a page that works without scripting. Then test it. Test it again - you surely skipped some essential test. Then, time permitting, you might consider whether you wish to add some optional enhancement using client-side scripting. - In reality, time seldom permits, and in any case, scripting as such is OFF-TOPIC in this group. |
#7
| |||
| |||
|
|
For heaven's sake, give it a rest. |
|
It's an *exercise*. |
|
I'm sure when you were learning all this, you went directly from zero to major world-shaking innovations, but most of us go through a lot of wheel-reinvention and wheel-imitation first. |
#8
| |||
| |||
|
|
Who made you the boss of what I should or shouldn't do? |
#9
| |||
| |||
|
|
Scripsit Harlan Messinger: For heaven's sake, give it a rest. "It"? You fullquoted like a moron, or a clueless newbie. It's an *exercise*. So what? It doesn't make it any more sensible, or any more on-topic. Learning stupid things when you should study the basics isn't a justification for anything. |
#10
| |||
| |||
|
|
I didn't say anything about its topicality. |
|
As for the issue that I'm challenging you on, since when is programming a small-scale keyboard-driven interactive application for learning purposes stupid? |
![]() |
| Thread Tools | |
| Display Modes | |
| |