Skip to content

Commit

Permalink
Added -- at start of each select
Browse files Browse the repository at this point in the history
  • Loading branch information
jloguercio committed Sep 24, 2015
1 parent d022ef0 commit 23124a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main/survey/ch_dropdown.php
Expand Up @@ -33,8 +33,8 @@ public function createForm($survey_data, $formData)
public function render(FormValidator $form, $questionData = array(), $answers = '')
{
$name = 'question' . $questionData['question_id'];
array_unshift($questionData['options'], '--');
$form->addSelect($name, null, $questionData['options']);

if (!empty($answers)) {
$form->setDefaults([$name => $answers]);
}
Expand Down
4 changes: 3 additions & 1 deletion main/survey/ch_score.php
Expand Up @@ -35,7 +35,9 @@ public function render(FormValidator $form, $questionData = array(), $answers =
{
$defaults = [];
foreach ($questionData['options'] as $key => & $value) {
$options = array();
$options = array(
'--' => '--'
);
for ($i=1; $i <= $questionData['maximum_score']; $i++) {
$options[$i] = $i;
}
Expand Down

0 comments on commit 23124a9

Please sign in to comment.