Can't display default value in combobox/valuelist

I have a combobox linked to a valuelist with display/real values. To show a default value in the combobox I normally use a method associated to the onShow event.

var theCombo = oneRealValue_fromtheList;

This usually works as expected, unless in the real value there is a backslash (""). My valuelist contains three elements:

LF(Unix)|\n
CR|\r
TAB|\t

While the real values are passed correctly to the dataprovider when chosen from the combobox, there is no way of showing a default value. When the form is shown the combobox is blank. I tried putting 2 backslashes (\n), enclosing in " " with no success. Any suggestion?

You mean that if you do this:

var theCombo = '\n'

it doesn’t work?

Yes, this doesn’t work. I have three comboboxes in a form used to import csv data. The first to set the field delimiters (valuelist: ;|; ,|, TAB|\t, default: “;”), the second for the line delimiters (valuelist: LF(Unix)|\n CR|\r, default: “\n”) and the third for the text qualifiers (valuelist: "|" '|' none| default: “"”).

The first combobox shows the semicolon as default value, while the others default to blank.

rioba:
I tried putting 2 backslashes (\n), enclosing in " " with no success.

Did you try that in the valuelist or in your script?

Because with the valuelist you described, I’m pretty sure that it works if you do this in your script:

var theCombo = "\\n";

It works, thanks Joas: I tried the double backslash in the valuelist only, in the valuelist and the script but not in the script only.