I have multiple identical forms. I need to submit them all at once. I cannot seem to figure out which one to use. I have attached pictures and code below please help. Any help is appreciated.
Hi,
If I understand you correctly, a user can fill in several forms for each student,
and you wish to save them all in once in your database, mean your dataset is on write-only mode.
use $w ( ‘#dataset1’). onReady() function and inside this event call to getInfo() function (maybe your code not working cause the dataset is not ready yet)
This was a big help. Now I’m working with the repeater and the forEachItem() function. It loops through the correct number of times but I’m doing something wrong because only the first students name is being passed through the loop
import wixData from 'wix-data';
function getInfo() {
$w('#repeater1').forEachItem(($item, itemData, index) => {
if ($w('#studentName').value !== null){
/*
$item("input4").value = itemData.studentName
$w('#dataset1').setFieldValue("studentName", $item("input4").value)
$w('#dataset1').save()
*/
console.log($w('#studentName').value)
}
});
}
export function button1_click(event) {
getInfo()
}
I was informed by someone who works for wix the repeaters do not allow user input. It is something they are working on. I started from scratch and hit a similar problem if you have a second to check it out please do. https://tmsimsedu.wixsite.com/theprocess
Any advice is appreciated