Error when dynamically adding combo boxes with javascript

I am dynamically adding combo boxes, but my array push as follows is not working

pp2combos.push(pp" + x + ");

I think it is because I am getting this error

Sorry you can see this in action if you go to and log in with

user demo
p/w demo99

Then navigate to Manage Recipes > add recipe > enter manually

Then click the Add Ingredient link at the bottom of the Ingredients section

You can use combos in form - there is a possibility to add items on fly: … items.html

I don’t see anything about adding combo boxes at that link.

I am already adding them, I just need to know what I am doing wrong

This link shows how to add items. It can be any form item you need, including combo

Would it be possible to just tell me how to get rid of the error, I don’t want to completely change how I have done things, and this used to work perfectly

To avoid this issue you just need to upgrade your suit to the current version


my.add.recipe.js line ~791
$(document).on(‘click’, ‘#adding’, function() {

then theCode variable is evaled, code dhtmlXComboFromSelect(‘unit" + x + "’) is failed because element with id ‘unit" + x + "’ is not found in the DOM

Any suggestions to get around the dom issue?

First you need to attach your element on page, then init combo