Quote from
smartmedia on February 22, 2026, 10:35 pm
BeginJS
// 1. We define Container (let's say you have named it Container1)
var container = $('#Container1');
// 2. We measure how many inputs are already inside the Container
to know the serial number (e.g. Input 1, Input 2, etc.)
var count = container.find('input').length + 1;
// 3. We create the new input.
The "form-control" class is the class of Bootstrap that gives the classic style of VisualNEO.
var newInput = $('<input type="text" id="DynamicInput_' + count + '" class="form-control" style="margin-top: 10px; " placeholder="New Input ' + count + '">');
// 4. (Optional) If you want the new input to automatically save what you write
to its own variable in VisualNEO (e.g. [MyVar1], [MyVar2] etc.)
newInput.on('input', function() {
var varName = 'MyVar' + count; Creates the name e.g. MyVar1
$rootScope[varName] = $(this).val(); It passes it to the memory of VisualNEO
if(!$rootScope.$$phase) $rootScope.$apply();
});
// 5. Add it (append) inside Container1
container.append(newInput);
EndJS
BeginJS
// 1. We define Container (let's say you have named it Container1)
var container = $('#Container1');
// 2. We measure how many inputs are already inside the Container
to know the serial number (e.g. Input 1, Input 2, etc.)
var count = container.find('input').length + 1;
// 3. We create the new input.
The "form-control" class is the class of Bootstrap that gives the classic style of VisualNEO.
var newInput = $('<input type="text" id="DynamicInput_' + count + '" class="form-control" style="margin-top: 10px; " placeholder="New Input ' + count + '">');
// 4. (Optional) If you want the new input to automatically save what you write
to its own variable in VisualNEO (e.g. [MyVar1], [MyVar2] etc.)
newInput.on('input', function() {
var varName = 'MyVar' + count; Creates the name e.g. MyVar1
$rootScope[varName] = $(this).val(); It passes it to the memory of VisualNEO
if(!$rootScope.$$phase) $rootScope.$apply();
});
// 5. Add it (append) inside Container1
container.append(newInput);
EndJS
luishp and asmat have reacted to this post.