[PATCH] tracking form value changes in onclick-handlers
Tobias Anton
TA at ESC-Electronics.de
Tue Jul 13 20:10:31 BST 2004
On Dienstag, 13. Juli 2004 02:06, bj at altern.org wrote:
> On Monday 12 July 2004 19.52, Tobias Anton wrote:
> > I'm planning to commit a patch like this one, and then I'd like to change
> > the default event handlers of activatable elements (links, form controls
> > and labels) to react on DOMACTIVATE_EVENT instead of CLICK_EVENT, or
> > event worse, MOUSEUP_EVENTS.
> >
> > Is there anything basically wrong or can I try this approach?
>
> Many webmail have a checkbox with something like this:
>
> <form>
> <input type="checkbox" onclick="anotherform.checked=this.checked">1<br>
> <input id="anotherform" type="checkbox"
> onclick="anotherform.checked=this.checked">2
> </form>
>
> Clicking on the checkbox 1 should always set the second checkbox to the
> same value. If you process the javascript events first, the this.checked
> will return a wrong value...
>
> I don't think your patch adresses this issue.
I just made a few other tests with IE. The bottom line is:
When a click event is to be processed, the following steps happen internally:
1. the old value of the form is backed up.
2. the value is changed
3. the onclick-javascript code is called
4. if the script returns false, the old value is restored.
And:
onclick-javascript is executed after both mouse clicks and pressing space.
This behaviour is resembled by this new patch (attached).
Comments and ideas welcome.
Cheers
-- Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp.diff
Type: text/x-diff
Size: 25350 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040713/f11f7acb/attachment.diff>
More information about the kfm-devel
mailing list