I am Dynamically adding radio buttons for each question using repeater from collection is creating problems while deployment as when I try to read radio button value (based on event context) I get error.
Worst thing is that everything works in sandbox, as soon as I deploy live I get error on browser, which occurs when I try to capture value.
I want to capture each event on the radio buttons by the user.
Any help will be appreciated, either correcting this method or suggest a new method all-together.
$w(“#radioGroup1”).onChange((event) => {
const repeaterData = $w(“#listRepeater”).data; // getting all the questions i am populating for the quiz (Question has title and text)
let $item = $w.at(event.context);
let answer= $item("#radioGroup1").value; // error occurs here
let itemId = event.context.itemId;
let itemData = repeaterData.find((item) => item._id === itemId);
let index = data.findIndex((item) => item._id === itemId);
let newdata = {"user_answer": answer, "time_of_answer" : Date.now()};
//this newdata will go to database
});