1

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-

1 Answer 1

0

You can do easily using jQuery

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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