elif answer.answer_type == 'text':
answer_value = answer.value_text
elif answer.answer_type == 'number':
- answer_value = answer.value_number
+ answer_value = answer.value_number.__str__()
elif answer.answer_type == 'date':
answer_value = answer.value_date
# TODO mettre les QCM ici
function prefill(){
var prefill_def = $.ajax(prefill_controller, {dataType: "json"})
.done(function(json_data){
- console.log(json_data)
_.each(json_data, function(value, key){
the_form.find(".form-control[name=" + key + "]").val(value);
});
.fail(function(){
console.warn("[survey] Unable to load prefill data");
});
+ return prefill_def;
};
// function validate(form){
console.debug("[survey] Custom JS for survey loaded!");
+ // Launch prefilling
prefill();
});
</template>
<template id="numerical_box" name="Numerical box">
- <input type="number" class="form-control" t-att-name="prefix"/>
+ <input type="number" step="any" class="form-control" t-att-name="prefix"/>
</template>
<template id="datetime" name="Datetime box">