top of page

Forum Posts

Caleb Gultig
Feb 23, 2021
In Coding with Velo
So I am trying to make a register that submits data into a database. The information required must use the members name and email without them adding it into the form. I know that you can reference the owner_ID but how do I make the form use this referenced data to submit into another database. This is the database that must show the Owner Name and email. This is the database I am trying to use as reference. When the owner submits the form it must send them a automated email response. This is what the final database should look like with all the required fields. Please help.
Creating a custom form with two datasets content media
0
1
39
Caleb Gultig
Dec 13, 2020
In Coding with Velo
There is a lot of code but I know you cannot use query selectors and need to use $w. I have also figured out that I need to make functions. I dont know JS enough to change it to suit wix please can somebody give me some advice. This code is to make a quiz that gives a total score. https://www.youtube.com/watch?v=f4fB9Xg2JEY thanks to Brian I could get the code. const question = document.querySelector('#question'); const choices = Array.from(document.querySelectorAll('.choice-text')); const progressText = document.querySelector('#progressText'); const scoreText = document.querySelector('#score'); const progressBarFull = document.querySelector('#progressBarFull'); let currentQuestion = {} let acceptingAnswers = true let score = 0 let questionCounter = 0 let availableQuestions = [] let questions = [     { question: 'What is 2+2?', choice1: '2', choice2: '4', choice3: '6', choice4: '8', answer: 2,     },     { question: 'An object is positively charged if it has more …', choice1: 'electrons than protons', choice2: 'electrons than neutrons.', choice3: 'protons than electrons.', choice4: 'protons than neutrons.', answer: 3,     },     { question: 'The UNIT in which the rate of flow of charge is measured, is called …', choice1: 'ampere.', choice2: 'coulomb.', choice3: 'volt.', choice4: 'watt.', answer: 1,     },     { question: 'The gradient of a velocity versus time graph is equivalent to the …', choice1: 'acceleration.', choice2: 'displacement.', choice3: 'position.', choice4: 'total distance covered.', answer: 1,     },     { question: 'Two cyclists are cycling in opposite directions along the side line of a rectangular field. It is observed that they covered the same distance over a time interval of 3 s. Which ONE of the following physical quantities is the SAME regarding the cyclists over the interval of 3 s?', choice1: 'Acceleration', choice2: 'Average speed', choice3: 'Average velocity', choice4: 'Displacement', answer: 2,     }, ] const SCORE_POINTS = 100 const MAX_QUESTIONS = 5 startGame = () => { questionCounter = 0 score = 0 availableQuestions = [...questions] getNewQuestion() } getNewQuestion = () => { if(availableQuestions.length === 0 || questionCounter > MAX_QUESTIONS) { localStorage.setItem('mostRecentScore', score) return window.location.assign('/end.html')     } questionCounter++ progressText.innerText = `Question ${questionCounter} of ${MAX_QUESTIONS}` progressBarFull.style.width = `${(questionCounter/MAX_QUESTIONS) * 100}%` const questionsIndex = Math.floor(Math.random() * availableQuestions.length) currentQuestion = availableQuestions[questionsIndex] question.innerText = currentQuestion.question choices.forEach(choice => { const number = choice.dataset['number'] choice.innerText = currentQuestion['choice' + number]     }) availableQuestions.splice(questionsIndex, 1) acceptingAnswers = true } choices.forEach(choice => { choice.addEventListener('click', e=> { if(!acceptingAnswers) return acceptingAnswers = false const selectedChoice = e.target const selectedAnswer = selectedChoice.dataset['number'] let classToApply = selectedAnswer == currentQuestion.answer ? 'correct' :'incorrect' if(classToApply === 'correct') { incrementScore(SCORE_POINTS)         } selectedChoice.parentElement.classList.add(classToApply) setTimeout(() => { selectedChoice.parentElement.classList.remove(classToApply) getNewQuestion()         }, 1000)     }) }) incrementScore = num => { score += num scoreText.innerText = score } startGame()
0
4
205
Caleb Gultig
Sep 26, 2020
In Coding with Velo
I want to create a wix data from where I can have it send them a email after submission. These people are regulars and it will be tedious to always add the email address every time, instead is there a way to have them put their name in and it will auto fill their email?
0
0
20

Caleb Gultig

More actions
bottom of page