[Solved] Extracting values in repeated elements from a repeater

@aeroengineerz7 You aren’t using my code. Please make sure you review the code and understand what it’s doing. Otherwise you won’t get the results that you want.

You need something like this:

$w("#submit").onClick(()=>{
   let answers = [];
   $w("#rptr").forEachItem(($item)=>{ 
      $w("#submit").onClick(()=>{
         console.log($item("#radioButton").value);
         let answer = $item("#radioButton").value;
         answers.push(answer);
      })
   })
   // all the answers are now available in the answers array
   console.log('all answers', answers);
   console.log(answers[0] + " " + answers[1] + " " + answers[2]);
})

Note: I haven’t tested this, and I’m not even sure that this is what you need, I’m just taking a guess by what you’re saying that you need.

@yisrael-wix THANK YOU VERY MUCH! It’s working now. :heart_eyes:
I really appreciate your time and effort just to help me with my problem.

I removed the 2nd onClick so it becomes like this…

$w( " #submit " ).onClick(()=>{
let answers = ;
$w( “#rptr” ).forEachItem(($item)=>{
console.log($item( “#radioButton” ).value);
let answer = $item( “#radioButton” ).value;
answers.push(answer);
})
// all the answers are now available in the answers array
console.log( ‘all answers’ , answers);
console.log(answers[ 0 ] + " " + answers[ 1 ] + " " + answers[ 2 ]);
})

And the result is this…