Page 1 of 1
Select object, exclude certain items for new records
Posted: Sun Sep 29, 2019 6:26 pm
by marc
My select field contains values (years) like 2019, 2018, 2017. For new records, the previous years should be excluded (2018, 2017) and only the current year should be in the drop down list. How can I do that?
Re: Select object, exclude certain items for new records
Posted: Mon Sep 30, 2019 8:46 am
by kev1n
Replace your_select_id with your select object id, add this code to the form's js field:
Code: Select all
if(nuIsNewRecord()) {
var currentYear = new Date().getFullYear();
$('#your_select_id option').filter(function () {
return parseInt(this.value) < currentYear;
}).remove();
}
Re: Select object, exclude certain items for new records
Posted: Tue Oct 01, 2019 11:37 am
by admin
Glen,
kev1n knows what he's talking about...
https://wiki.nubuilder.cloud/ ... b_-_Select
Steven