Index: trunk/extensions/Survey/resources/jquery.survey.js |
— | — | @@ -66,15 +66,27 @@ |
67 | 67 | } ); |
68 | 68 | break; |
69 | 69 | case type.SELECT: |
70 | | - $input = survey.htmlSelect( question.answers, 0, { |
| 70 | + var answers = {}; |
| 71 | + |
| 72 | + for ( i in question.answers ) { |
| 73 | + answers[question.answers[i]] = question.answers[i]; |
| 74 | + } |
| 75 | + |
| 76 | + $input = survey.htmlSelect( answers, 0, { |
71 | 77 | 'id': id, |
72 | 78 | 'class': 'survey-question survey-select' |
73 | 79 | } ); |
74 | 80 | break; |
75 | 81 | case type.RADIO: |
| 82 | + var answers = {}; |
| 83 | + |
| 84 | + for ( i in question.answers ) { |
| 85 | + answers[question.answers[i]] = question.answers[i]; |
| 86 | + } |
| 87 | + |
76 | 88 | $input = survey.htmlRadio( |
77 | | - question.answers, |
78 | | - 0, |
| 89 | + answers, |
| 90 | + null, |
79 | 91 | id, |
80 | 92 | { |
81 | 93 | 'id': id, |
Index: trunk/extensions/Survey/resources/ext.survey.js |
— | — | @@ -59,14 +59,18 @@ |
60 | 60 | $radio.html( '' ); |
61 | 61 | |
62 | 62 | for ( message in options ) { |
63 | | - var value = options[message]; |
64 | | - var id = name + value; |
| 63 | + var itemValue = options[message]; |
| 64 | + var id = name + itemValue; |
65 | 65 | |
| 66 | +// if ( value === null ) { |
| 67 | +// value = itemValue; |
| 68 | +// } |
| 69 | + |
66 | 70 | $input = $( '<input />' ).attr( { |
67 | 71 | 'id': id, |
68 | 72 | 'type': 'radio', |
69 | 73 | 'name': name, |
70 | | - 'value': value |
| 74 | + 'value': itemValue |
71 | 75 | } ); |
72 | 76 | |
73 | 77 | if ( value === options[message] ) { |