gittip/www.gittip.com — pull request #725 by wilkie (2013-03-12 08:46:08+00:00)
Title: Allows focus on goal amount text field.

The current label for giving a funding goal contains a text field to
enter the amount. Since this is a radio input, and the label for this
radio option contains the text input, (that is, since the text field is
the label) clicking on the text field is the same as clicking on the
label... switching focus to the radio input on FX and IE.

This prevents people from entering in a value. The typical way to do
this is to actually separate the input from the label and using
javascript to 'check' the radio when the field is clicked or otherwise
updated (by keyboard.)

This change adds that javascript. It will select the radio option when
the text field or the surrounding text is clicked. It will also select
the radio option if the text field is tabbed-to and updated (if no mouse
is used.)

When no javascript is available, it will not select the radio option.
The user will have to click on the radio option first.

Another possible method (not explored here... it would be an alternative fix) would be to disable the text field until the radio option is selected. I elected to keep the current behavior, however, and implemented a fix that allows FX and IE to act like Chrome+gittip currently.