- Mensajes: 47
- Karma: 1
- Gracias recibidas: 0
- Comunidad
- Foros
- English support forums
- Can I do this with LimeSurvey?
- Default selected "Yes" for a particular question
Default selected "Yes" for a particular question
- amritdeep
-
Autor del tema
- Fuera de línea
- Senior Lime
-
Menos
Más
7 años 4 meses antes #83487
por amritdeep
Default selected "Yes" for a particular question Publicado por amritdeep
In my survey there is question
Que: Is it ok?
yes/no
I want that "Yes" selected by default.
for this i have used following code what didn't work
<script type="text/javascript" charset="utf-8">
document.getElementById('answer82352X12X333Y').checked = 'checked';
</script>
Que: Is it ok?
yes/no
I want that "Yes" selected by default.
for this i have used following code what didn't work
<script type="text/javascript" charset="utf-8">
document.getElementById('answer82352X12X333Y').checked = 'checked';
</script>
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
- Ben_V
-
- Fuera de línea
- Platinum Lime
-
Menos
Más
- Mensajes: 1876
- Karma: 120
- Gracias recibidas: 516
7 años 4 meses antes - 7 años 4 meses antes #83496
por Ben_V
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Respuesta de Ben_V sobre el tema Default selected "Yes" for a particular question
Try this one
Ben/

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
document.getElementById('answer82352X12X333Y').checked = 'checked';
});
</script>
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Última Edición: 7 años 4 meses antes por Ben_V.
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
- amritdeep
-
Autor del tema
- Fuera de línea
- Senior Lime
-
Menos
Más
- Mensajes: 47
- Karma: 1
- Gracias recibidas: 0
7 años 4 meses antes #83509
por amritdeep
Respuesta de amritdeep sobre el tema Default selected "Yes" for a particular question
Its working. Thanks a lot Sir !


Por favor, Identificarse o Crear cuenta para unirse a la conversación.
Menos
Más
- Mensajes: 8561
- Karma: 621
- Gracias recibidas: 2627
7 años 4 meses antes #83531
por tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Respuesta de tpartner sobre el tema Default selected "Yes" for a particular question
You may want to put in a conditional so the default only gets checked if nothing has already been checked:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
if($('#question333 input.radio:checked').length == 0) {
document.getElementById('answer82352X12X333Y').checked = 'checked';
}
});
</script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
- amritdeep
-
Autor del tema
- Fuera de línea
- Senior Lime
-
Menos
Más
- Mensajes: 47
- Karma: 1
- Gracias recibidas: 0
7 años 4 meses antes - 7 años 4 meses antes #83537
por amritdeep
Respuesta de amritdeep sobre el tema Default selected "Yes" for a particular question
Última Edición: 7 años 4 meses antes por amritdeep.
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
- startx25
-
- Fuera de línea
- Senior Lime
-
Menos
Más
- Mensajes: 52
- Gracias recibidas: 0
7 años 2 meses antes #86164
por startx25
Respuesta de startx25 sobre el tema Default selected "Yes" for a particular question
Amritdeep, do you have find a solution, i have the same problem.
Thank for your help
Thank for your help
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
Menos
Más
- Mensajes: 8561
- Karma: 621
- Gracias recibidas: 2627
7 años 2 meses antes #86239
por tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Respuesta de tpartner sobre el tema Default selected "Yes" for a particular question
It should work with the imageTick plugin if you place the code that selects the radio button BEFORE the code that applies imageTick.In the case of "Images for radio buttons" this code is not working.
$(document).ready(function(){
if($('#question333 input.radio:checked').length == 0) {
document.getElementById('answer82352X12X333Y').checked = 'checked';
}
// Apply images to radios
$('input[type="radio"]').imageTick({
// Image to use as a selected state of the radio
tick_image_path: "upload/templates/yourTemplateName/radio.gif",
// Image to use as a non-selected state
no_tick_image_path: "upload/templates/yourTemplateName/no_radio.gif",
// Class to apply to all radio images that are dynamically created
image_tick_class: "radios"
});
// Apply images to checkboxes
$('input[type="checkbox"]').imageTick({
// Image to use as a selected state of the checkbox
tick_image_path: "upload/templates/yourTemplateName/check.gif",
// Image to use as a non-selected state
no_tick_image_path: "upload/templates/yourTemplateName/no_check.gif",
// Class to apply to all checkbox images that are dynamically created
image_tick_class: "checkboxes"
});
});
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
- startx25
-
- Fuera de línea
- Senior Lime
-
Menos
Más
- Mensajes: 52
- Gracias recibidas: 0
7 años 2 meses antes #86274
por startx25
Respuesta de startx25 sobre el tema Default selected "Yes" for a particular question
Thank you very much tpartner
That's work fine : BEFORE the code that applies imageTick.
Regards,
Startx25
That's work fine : BEFORE the code that applies imageTick.
Regards,
Startx25
Por favor, Identificarse o Crear cuenta para unirse a la conversación.