Hi all. I have some fields in my form that can be duplicate by checking a checkbox. If I enter data by the keyboard it persists provided data. But if I check the box, it updates the input boxes that could be duplicate on the screen but not the collections’s fields, after submitting. In addition, after I have defined a specific field as a “MAIN FIELD”, I expected to get just one record to that content but it is allowing more than one record with the same value. I noticed that there is a Created Date automatic field that is a Main Field to. Can it being resulting in a composed key, allowing my main field to be NOT unique? (any fields that can be duplicate is a key in the collection, I mean, they are not MAIN FIELDS) Thanks for advance.
Follow the code:
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
$w.onReady( function () {
});
export function checkbox1_change(event, $w) {
if ($w(“#checkbox1”).checked === true ){
$w(“#input5”).value = $w(“#input4”).value;
$w(“#input15”).value = $w(“#input14”).value;
$w(“#input18”).value = $w(“#input17”).value;
$w(“#dropdown3”).value = $w(“#dropdown2”).value
$w(“#input6”).value = $w(“#input1”).value;
} else {
$w(“#input5”).value =“”;
$w(“#input15”).value = “”;
$w(“#input18”).value = “”;
$w(“#dropdown3”).value = “”;
$w(“#input6”).value = “” ;
}
}
export function checkbox2_change(event, $w) {
if ($w(“#checkbox2”).checked === true ){
$w(“#input9”).value = $w(“#input7”).value;
} else {
$w(“#input9”).value =“”;
}
}