Topic: reset a select box for observe_field?
I have a select box with the first option being blank and a number of other options. I am using observe_field to call an RJS script when the user changes their selection. In my RJS file, I include the following line:
page << "$('selectbox_id').selectedIndex = '0';"
which simply resets the select box to its default no-value state. But, the EventObserver still remembers the old state and doesn't seem to change it's 'lastValue'. That is, suppose I select an option with value "1". Once I select it, the select box will reset its selected index back to 0. But if I then select option "1" again, the EventObserver won't recognize that as a change in the selected value. Does anyone know of a workaround for this?