G
Gene Wirchenko
Hello:
This is posted to both comp.lang.javascript and alt.html, because
it might have to do with either JavaScript or HTML. I expect that it
is the former, but.
My form handler is coming along slowly, but the results are nice.
I am now adding buttons for handling modes (adding, updating,
deleting). When data entry is being done, only some of the controls
are enabled. If a button or input control is disabled, it can get
weird.
Suppose that DE is being done. Call the current input control
Workpoint.
If I click on something that is not enabled, the validation for
Workpoint executes.
If there is a validation error, an alert is issued, and the focus
gets put back to Workpoint. (Spare me that this not how Web pages
should work. "Sticky" focus on errors is what is needed and wanted.)
However, if there is not a validation error, the focus goes off
somewhere I know not where, AND I CAN NOT TELL WHERE. I want the
focus back on Workpoint.
The focus, despite not showing on the form, can be moved. If I
press [Tab] immediately after this, the focus moves to the first
enabled control on the form. This is weird.
Ideally, I would like that when a non-enabled item is clicked on,
that the click is ignored, that is, it is as if nothing had happened.
If I can not have that, I would, at least, like to have the focus
returned to Workpoint whether the validation succeeds or not.
Unfortunately, document.currentElement does not give me a value
that I can work with so that I can detect the weirdness. How can I
tell where the focus is going? (I think I would then check if the
control is disabled, and if so, set focus back to Workpoint.)
Sincerely,
Gene Wirchenko
This is posted to both comp.lang.javascript and alt.html, because
it might have to do with either JavaScript or HTML. I expect that it
is the former, but.
My form handler is coming along slowly, but the results are nice.
I am now adding buttons for handling modes (adding, updating,
deleting). When data entry is being done, only some of the controls
are enabled. If a button or input control is disabled, it can get
weird.
Suppose that DE is being done. Call the current input control
Workpoint.
If I click on something that is not enabled, the validation for
Workpoint executes.
If there is a validation error, an alert is issued, and the focus
gets put back to Workpoint. (Spare me that this not how Web pages
should work. "Sticky" focus on errors is what is needed and wanted.)
However, if there is not a validation error, the focus goes off
somewhere I know not where, AND I CAN NOT TELL WHERE. I want the
focus back on Workpoint.
The focus, despite not showing on the form, can be moved. If I
press [Tab] immediately after this, the focus moves to the first
enabled control on the form. This is weird.
Ideally, I would like that when a non-enabled item is clicked on,
that the click is ignored, that is, it is as if nothing had happened.
If I can not have that, I would, at least, like to have the focus
returned to Workpoint whether the validation succeeds or not.
Unfortunately, document.currentElement does not give me a value
that I can work with so that I can detect the weirdness. How can I
tell where the focus is going? (I think I would then check if the
control is disabled, and if so, set focus back to Workpoint.)
Sincerely,
Gene Wirchenko