It's a long story, but here are the essentials. I have a drop down field that gets populated by a lookup. Then if certain criteria is met, I add on an <option> value to the list using javaScript:
//add Janice Vassell id dept = 42 if ($('.depCode input').val()=='42'){ $.each($('.AltApvList option'), function(){ allApvrs.push($(this).val()); });//each if ($.inArray('JANICE N VASSELL', allApvrs) == -1){ $('.AltApvList select').append('<option>JANICE N VASSELL</option>'); } }//if dept = 42 });
^In this example I add "JANICE N VASSELL" to the drop down list.
I really need to add one or two more names to the list as well. The issue is with sorting. How can I use javaScript to sort this list after I have added the custom values? I can't get it to sort the lookup values or anything else....
I have tried several sites (stack overflow & custom pen) but I believe the code their isn't compatible with the jQuery library Forms is running. That or I just don't know how to alter it to work correctly.
@████████ I am guessing this is right up your alley.
Any suggestions are welcome :)
Thank you in advance
Chris