So right now I din’t set the limit, so if there is too much team register then I will be in problem.
I hope to set a limit to I can control the input from public.
So there is “Team Name” as the main field
and the rest will be:
-Team Lead ID
-Team Leader Name
IC 1
Contact 1
Player 2
IC 2
Contact 2
Player 3
IC 3
Contact 3
Player 4
IC 4
Contact 4
Player 5
IC 5
Contact 5
Also there is image upload that is not compulsory,
and also agree to T&C tick which is required.
I suggest you to add a method at the onReady() function that runs before the user starts interacting with your page. The function will count how many teams have registered already and if they rich the limit change all the user input’s properties to be hidden and add a pup up message or lightbox.
$w.onReady( function() {
} );
In order to get the amount of items use Query() function ( results.items.length )
In order to hide the user’s input use hide() function.
Now I have the result of count, how do I use the results to make an if else statement?
like if result =>16 then #box1 is hidden, else do nothing.
Currently my code is like this…
// For full API documentation, including code examples, visit http://wix.to/94BuAAs import wixData from ‘wix-data’;
$w.onReady( function () {
//TODO: write your page related code here…
wixData.query(“MOBILE_LEGEND_DOJO_ROUND_2”)//Your collection name here
.count() // Counts how many items in collection
.then((results)=> {
console.log(results); //2
}) if ( $w(“#box1”).hidden ) {
$w(“#box4”).show();
} else {
$w(“#box4”).hide();
}
});