“Selected Value Does Not Exist” on a dynamically generated field
-
Hello, I am using JavaScript to dynamically load a select field’s options. Those load just fine, but when a user submits the form, the error message “Selected Value Does Not Exist” pops up underneath that field. Is there a step I may be missing? The field has the class “.propDrop” assigned to it, and arraySelect is an array of the options.
if ( arraySelect.length >= 1 ) {
? ? ? ? //creates the options in the dropdown
? ? ? ? for(var j=0; j<arraySelect.length; j++) {
? ? ? ? ? ? var prop = arraySelect[j].property;
? ? ? ? ? ? jQuery('.propDrop div select').append('<option value="' + prop + '" data-email="'+ arraySelect[j].email +'" data-id="'+ arraySelect[j].id +'">' + prop + '</option>');
? ? ? ? }
? ? }
? ? else {
? ? ? ? jQuery('.propDrop').remove();
? ? }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘“Selected Value Does Not Exist” on a dynamically generated field’ is closed to new replies.