Multi-Item Select for Form Input
Here is a solution if you have a table where you would like to add multiple products from a particular supplier.
Step 1
In the Users table, add a connection to the Orders table (or the table where you store the selected products)
Step 2
Add New Order Page, using the JavaScript code below, auto-save it & update the User with the new order, and finally redirect to the Edit Order or Detail page.
Step 3
From the Edit/Detail Order page, add the Products table.
Step 4
In the Products table, add the Edit button; this will show the selected product; using JavaScript, you will autosave with Insert to the connected table, and this will add +1 of the chosen products into the Order from the selected User. And finally, auto closes the page.
JavaScript Code:
// Auto click of Button “Save & Update” once loaded:
// ***********************************************************************************************
var onLoadEditProject = false;
// alert("Here you are : ");
function forceSubmitEditProject() {
if (onLoadEditProject === false) {
if ($(’#x_element_page_106_3.form - submit.af - form - submit’).html() !== undefined) {
onLoadEditProject = true;
}
window.setTimeout(forceSubmitEditProject, 100);
} else {
// alert("Here you are : ");
$(’#x_element_page_106_3.form - submit.af - form - submit’).click();
}
}
TB.render(‘component_4’, function() {
forceSubmitEditProject();
});
// End of : Auto click of Button “Save & Update” once loaded:
//***********************************************************************************************
Replace x_element_page_10_4 with your page’s element id.
Replace component_4 with the component info from the page builder
Original Community Post:
https://community.tadabase.io/t/multi-item-select-for-form-input/1107
We'd love to hear your feedback.