Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
Iterated over a checkbox and displaying a user's input in App Studio

I'm trying to take a user's input from a checkbox in AppStudio, storing it in a list, and then displaying that list. However, when I run this code the chosenFoods list is blank.

var checkboxFoodChoices = ["mexican", "italian", "chinese", "american", "brazilian", "french"];
var chosenFoods = [];

button2.onclick=function(){
    for(var j = 0; j < checkboxFoodChoices.length; j++){
      if(checkbox1.getValue(j) == checkboxFoodChoices[j]){
            chosenFoods[j] = checkboxFoodChoices[j]
            
          } // if statement
      } //for loop
    console.log(chosenFoods)
} //onclick

I tried it a different way but the list then displays [empty, empty, chinese] if I chose the third value in the list instead of just [chinese]

var checkboxFoodChoices = ["mexican", "italian", "chinese", "american", "brazilian", "french"];
var chosenFoods = [];

button2.onclick=function(){
    for(var j = 0; j < checkboxFoodChoices.length; j++){
      if(checkbox1.getValue(j)){
            chosenFoods[j] = checkboxFoodChoices[j]
          } // if statement
      } //for loop
    console.log(chosenFoods)
} //onclick
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda