Data is not sending to the database on mobile device.

Hey,
I am having trouble setting up a quiz by code on Wix. I have a database, which gets populated when I play the quiz. The problem is that it’s not sending data to the database when I am playing quiz on mobile but works fine when I play on my laptop.
The code and the ids are same for all the input devices and the button.
This is the code:

import wixData from ‘wix-data’ ;
// API Reference: Introduction - Velo API Reference - Wix.com
// “Hello, World!” Example: Velo Learning Center
let countA = 0 ;
let countB = 0 ;
let countC = 0 ;
let recommendation ;
$w . onReady ( function () {

});

export function btnNext_click ( event ) {
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q1’ );
}

export function button29_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q2’ );
}

export function button30_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q2’ );

} export function button31_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q2’ );
}

export function button34_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q3’ );
}

export function button33_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q3’ );
}

export function button32_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q3’ );
}

export function button37_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q4’ );
}

export function button36_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q4’ );
}

export function button35_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q4’ );
}

export function button40_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q5’ );
}

export function button39_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q5’ );
}

export function button38_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q5’ );
}

export function button43_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q6’ );
}

export function button42_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q6’ );
}

export function button41_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q6’ );
}

export function button46_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q7’ );
}

export function button45_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q7’ );
}

export function button44_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q7’ );
}

export function button49_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q8’ );
}

export function button48_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q8’ );
}

export function button47_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q8’ );
}

export function button55_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q9’ );
}

export function button54_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q9’ );
}

export function button53_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q9’ );
}

export function button58_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q10’ );
}
export function button57_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q10’ );
}

export function button56_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Q10’ );
}

export function button52_click ( event ) {
countA = countA + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Result’ );
}

export function button51_click ( event ) {
countB = countB + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Result’ );
}

export function button50_click ( event ) {
countC = countC + 1 ;
$w ( ‘#EmptyFullStateBox’ ). changeState ( ‘Result’ );
}

export function EmptyFullStateBox_change ( event ) {
var max = Math . max ( countA , countB , countC );
if ( max == countA ){
recommendation = “VATA” ;
$w ( ‘#resultHead’ ). html = ‘<h1 style="color:#48685F;font-family:“Tenali Ramakrishna” ">You have a predominant VATA Body Type:’ ;
$w ( ‘#resultParagraph’ ). html = ‘<p style="color:#48685F;font-family:“Tenali Ramakrishna”;font-size:“1.5rem” ">People born with Vata Dosha are usually active, creative and are gifted with the natural ability to express and communicate. They are also quick learners, have a lively and fun personality, and are full of joy and enthusiasm when in balance.But when their Vata goes out of balance, they start showing tendencies to act on impulse, mood swings and respond to stress with fear, anxiety and worry. Some of the common signs of Vata imbalance also include bodily disorders related to dryness of skin, dry cough, constipation, lower back pain, menstrual disorders and abdominal pain among others. Vata Skin is usually dry to normal and is fine textured with small pores which shows signs of dehydration and scales when scratched. Even signs of ageing and wrinkles as well as mature skin is symbolic of Vata Similarly, Vata Scalp is also dry which is unable to nourish the hair leading to dry, thin, frizzy, and sometime curly hair. A Vata imbalance may lead to excessive hair thinning and split ends.

} 
**else if**  ( max == countB ) { 
    recommendation  =  "PITTA" ; 
    $w ( '#resultHead' ). html  =  '<h1 style="color:#48685F;font-family:"Tenali Ramakrishna"">You have a predominant PITTA Body Type:</h1>' ; 
    $w ( '#resultParagraph' ). html  =  '<p style="color:#48685F;font-family:"Tenali Ramakrishna";font-size:"1.5rem"">People of pitta body type are usually of medium built and have a delicate and slender body frame. They usually have a fair or reddish kind of complexion.The pitta people have a strong metabolism and good digestion which results in them having a strong appetite. They have a natural craving for both sweet and bitter food items and may take food and liquids in large quantities.People with pitta body type have a sharp mind with excellent concentration powers. They tend to quickly comprehend situations and react with agility. They are considered to be good orators and generally possess good management and leadership skills. They are usually competitive by nature and enjoy challenges.Pitta skin is sensitive and has pink tones with medium pores which is vulnerable to breakouts, sunburn and acne. Pitta people will have a lot of glow and shine on the face. Since Pitta is associated with heat, it may heat up the hair roots leading to premature greying and tendency towards hair fall. Pitta people will have lighter tones of hair but silky and thin.</p>' 
    
} 
**else**  { 
    recommendation  =  "KAPHA" ; 
    $w ( '#resultHead' ). html  =  '<h1 style="color:#48685F;font-family:"Tenali Ramakrishna"">You have a predominant KAPHA Body Type:</h1>' ; 
    $w ( '#resultParagraph' ). html  =  '<p style="color:#48685F;font-family:"Tenali Ramakrishna";font-size:"1.5rem"">Kapha people usually constitute well-developed bodies but also have a tendency to carry excess weight. Kapha people are usually loving in nature, easy going, relaxed and slow paced. They are compassionate and non-judgmental people and have a graceful appearance. They do not get upset easily and are known to be possessive by nature and so hold on to things and people for a long period of time. They have a regular appetite but due to slow digestion they tend to consume less amount of food. They possess good stamina and generally remain happy, healthy and peaceful. Kapha skin is normal to oily and is smooth and well hydrated with larger pores around nose and cheeks. A kapha imbalance may cause some pustular breakouts as well as blackheads. Kapha hair are oily, smooth, thick, and soft. However, an imbalance in Kapha may lead to dandruff.</p>' 
    
} 

console . log ( max , countA , countB , countC ); 

}

export function button25_click ( event ) {
let toSave = {
“email” : $w ( ‘#input5’ ). value ,
“firstName” : $w ( ‘#input7’ ). value ,
“lastName” : $w ( ‘#input6’ ). value ,
“recommendation” : recommendation ,
};
wixData . save ( “Quiz” , toSave )
. then ( ( results ) => {
let item = results ;
} )
. catch ( ( err ) => {
let errorMsg = err ;
} );
console . log ( toSave );
console . log ( $w ( ‘#input5’ ). value );
}

export function button59_click ( event ) {
let toSave = {
“email” : $w ( ‘#input5’ ). value ,
“firstName” : $w ( ‘#input7’ ). value ,
“lastName” : $w ( ‘#input6’ ). value ,
“recommendation” : recommendation ,
};
wixData . save ( “Quiz” , toSave )
. then ( ( results ) => {
let item = results ;
} )
. catch ( ( err ) => {
let errorMsg = err ;
} );
console . log ( toSave );
console . log ( $w ( ‘#input5’ ). value );
}

and this is the database:

This is the frontend:


Also, there are 10 pages in between the introduction and this result page containing 10 questions.
Please help!

Add console.log() to your database entry code and see what happens on the console on the mobile version. You can see the mobile version console from a regular chrome browsers if you just change the format to iPhone -


Then reload and you will see mobile -

I am facing the exact same issue for my code on Wix website but only on iPhone. The code works perfectly on desktop browser and android mobile phones but doesn’t work on iPhone. Is there a solution to this?