[Javascript] Dirty Button
Paul Novitski
paul at juniperwebcraft.com
Mon Jan 26 01:13:35 CST 2009
At 1/25/2009 12:37 PM, Claude Schneegans wrote:
>Solution looks fine, but where is the problem?
>Why do you need to show the user what he selected?
>If you really need it, just update the "You Selected" innerHTML on a
>onchange event.
I assume that Tedd's fundamental goal was to ensure (without using
XMLHttpRequest) a match between the client-side display and the
server-side data, as set by the previous submit, not simply to
duplicate the form control settings in the client-side display.
At the risk of being overly obvious, though, I'll point out that the
principal problem Tedd is trying to solve exists only when the input
form and the calculated result of form submission coexist on the same
page. Another model for the user interface, in which the form and
its result each resides on its own page, bypasses this problem
completely. For instance, the results page might have a 'run again'
link or button to return to the form which is always populated by the
current server-side data. What such a two-page model may lack in
sexiness it certainly makes up for in unambiguous clarity and a
guaranteed match between form state and stored data.
>At 1:23 PM -0500 1/25/09, Gene Berger wrote:
>>I like the concept! The only thing is that if the EU clicks one of the
>>dropdowns but does NOT change the selection, the color of the buttons still
>>changes. Perhaps if the selection doesn't change the color of the button
>>shouldn't change.
At 1/25/2009 11:03 AM, tedd wrote:
>I thought about that as well, but I wanted to keep the solution
>simple. I'll give that some thought though.
At 1/25/2009 01:32 PM, Matt Warden wrote:
>It doesn't seem to work if you use the keyboard to alter the select
>values rather than the mouse.
Tedd, these criticisms are radical. To create a signal that the
value has changed and allow it to indicate a situation in which the
value hasn't changed, or fail to signal an actual change, means that
you haven't finished writing it. Misleading assistance is worse than
no assistance at all.
It would be simple enough to download the form with the current value
duplicated -- say as an element in the control's own class -- so that
your algorithm can know when it's truly dirty and when it's not.
Regards,
Paul
__________________________
Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com
More information about the Javascript
mailing list