I have an entity reference field using a view to dynamically create a list based on a contextual filter from a user ID in URL. Works perfectly.

Question is, how can I default the value to the first result in the list, instead of displaying -None- or -Please select-


You can do easily using jQuery

$("#target").val($("#target option:first").val());
  • Sure, jQuery was a last resort. Thanks for your answer though. – user2447487 Jan 29 '16 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.