Insert a new answer via javascript

Más
3 meses 2 semanas antes #183982 por mpac_limes
I'm trying to insert a whole set of answers via javascript but they seem to fail validation when one of them is the selected option.

I've already seen THIS POST but either it doesn't work for me or I don't understand what I'm supposed to do. I think this same thing was a breeze to do in earlier versions of LS :(

By the way, text label and value are equally important for the purpose of the question.

I've attached a sample survey, but the point is in adding a new option via javascript and to get LS accept it as a valid answer


Thanks
Adjuntos:

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

LimeSurvey Partners
Más
3 meses 1 semana antes #184042 por mpac_limes
Respuesta de mpac_limes sobre el tema Insert a new answer via javascript
Let me reformulate the question:

What do I have to do after my javascript code has inserted a new answer option in a single choice question (dropdown) for Limesurvey to accept it as a valid one when chosen by the user.

If I insert it and then do nothing, when it is chosen it fails validation and the form won't allow to advance to the next sections.

Any help would be appreciated.

Thanks

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Más
3 meses 1 semana antes - 3 meses 1 semana antes #184047 por tpartner
Respuesta de tpartner sobre el tema Insert a new answer via javascript
It look like a validation was introduced a couple of years ago - github.com/LimeSurvey/LimeSurvey/commit/...a9d461e4ea80c9R10257

A possible workaround may be to use a short-text question and build a complete drop-down to load it with JavaScript.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Última Edición: 3 meses 1 semana antes por tpartner.
El siguiente usuario dijo gracias: DenisChenu

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

¡Comenzar ahora!

Simplemente cree una cuenta y comience a usar LimeSurvey hoy mismo.

Registrarse ahora
¡Únase a nuestro boletín informativo!

Iniciar sesión