If the user selects the Other option, and enters one of the specified known values, the value should be saved as if the user selected that value in the fist place. For example. If you have the following select:

home|Home
mobile|Mobile
Other

If the user selects 'Other' and enters 'mobile' in the other box, currently the result is presented as select like so:

home|Home
mobile|Mobile
> Other => 'mobile'

Where it would make a lot more sense if it were more like:

home|Home
> mobile|Mobile
Other
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewschmaltz’s picture

Agreed, I'll look at how this might be possible. Has anyone else solved this?

joco_sp’s picture

This would be great :)

legolasbo’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Issue summary: View changes

I'm unsure wether to qualify this as a feature request or a bug report. Either way I think this is important to fix/implement. Moving the issue to the 7.x-3.x-dev branch because (custom) modules might be expecting this behaviour in the 7.x-2.x branch.

legolasbo’s picture

Status: Active » Needs review
FileSize
3.84 KB

This should fix the problem.

I will also write tests.

legolasbo’s picture

FileSize
8.74 KB

While writing tests I encountered an bug in my earlier refactoring. Attached patch fixes this bug and adds tests for Select or Other's default behaviour. Still have to write the tests for the feature implemented in this issue.

  • legolasbo committed b0a8c39 on 7.x-3.x
    Issue #1818876 by legolasbo: Other text should save as known value, if a...
legolasbo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.