/
Limit the number of selectable options
Convertigo Public Knowledge base
Limit the number of selectable options
In a PWA form, if you want to limit the number a user can click checkboxes, you have to use a Business Logic:
Business Logic
(()=>{var max=3;if(<checkbox1>.filter((e)=>{return e.selected == true}).length > max){console.log("max options selected reached!");<checkbox1>=JSON.parse(JSON.stringify(page["local"]["__c8o_max_check"]));window.setTimeout(()=>{alert("You can not select more than "+max+" options.")},250);}else{console.log("Max not reached!");page["local"]["__c8o_max_check"]=JSON.parse(JSON.stringify(<checkbox1>))}})()
<checkbox1>
is the technical name of the Checkbox component.
This will result in:
3 maximum checkboxes
the max variable sets the max number of checkboxes that can be checked.
console.log and alert are optional.
Here is the form to import in your No Code Studio environment:
Related content
Conditional Mailing List from checkboxes/radio
Conditional Mailing List from checkboxes/radio
More like this
Send multi values to a NoCode Database
Send multi values to a NoCode Database
More like this
CouchDB database size management
CouchDB database size management
More like this
How to use automatic Form Inputs generation from a Back End Sequence?
How to use automatic Form Inputs generation from a Back End Sequence?
More like this
Studio No Code - Business Logic - Dynamic Mail Address
Studio No Code - Business Logic - Dynamic Mail Address
More like this
Custom ActionSheet Controller
Custom ActionSheet Controller
More like this
(c) Convertigo 2023 https://www.convertigo.com