View Full Version : Why does setting the Select field show the Value sometimes then show the Text sometim

25 Jan 2012, 9:15 AM
I have a select field of states. The values are State Abbreviations like DC and the text is Washington DC.

However, on the first postback I see that the Value is displayed on the select field. Then revisiting the panel shows Washington DC. What would cause this?

12 Apr 2012, 5:24 AM
I actually have a similar problem.
My select allows users to select "10 items" (value 10), "20 items" (value 20) and "30 items" (value 30).
When I first display the select it displays the default "10 items". I then change that to 20 items, leave the view that displays the select, and go back to the view again and in some cases it will show "20" instead of "20 items". It doesn't always happen and I haven't found any patterns for it happening or not yet.

12 Apr 2012, 5:33 AM
Oh boy, just when I submitted the previous post, something hit me.
The data I get from my select is stored in localStorage and retrieved from that again.
I thought that maybe the data type got mangled somewhere, and indeed, playing around with some "typeof" debug statements I figured out that I tried to feed a string value to the "value" config option of the select field. In other words, I passed the string value "20" instead of the numeric value 20. Forcing it to become an int with parseInt solved the problem for me.

I don't think this will actually solve the problem of the original poster though, unfortunately.