Add handling for empty multi-line text field
Since empty multi-line fields are ‘null’ rather than an empty string, the last commit was attempting to call replace() on ‘null’ for empty fields and subsequently erroring out.
This commit is contained in:
Родитель
d3c3c7c689
Коммит
829fc90884
4
app.js
4
app.js
|
@ -169,8 +169,8 @@
|
|||
if (field.type === 'date') {
|
||||
result.value = (result.value ? this.toLocaleDate(result.value) : '');
|
||||
}
|
||||
else if(field.type === 'textarea') {
|
||||
result.value = values[key].replace(/</g,'<').replace(/>/g,'>').replace(/\n/g,'<br>');
|
||||
else if(field.type === 'textarea' && values[key] != null) {
|
||||
result.value = _.escape(values[key]).replace(/\n/g,'<br>');
|
||||
result.html = true;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче