I have this code that gets the values of richselects. But it gets all of them in the form, even the hidden ones. The hidden ones have no options until the parent of the hidden one is active (these can be optional). Therefore when the form is submitted, I get an undefined error because these hidden fields have no value.
var formValues = form.getValues();
for(var i in form.elements){
var input = form.elements[i];
if(input.getText){
formValues[input.config.name] = input.getText();
}
}
Is there a way to ignore hidden fields within the block of code above?