- Issue created by @tinohuda
- Status changed to Closed: won't fix
over 1 year ago 2:30pm 11 June 2023 - 🇺🇸United States jrockowitz Brooklyn, NY
The feature is not available. You would have to write custom Ajax code to accomplish it.
- 🇮🇩Indonesia tinohuda
Hi @jrockowitz thank for your reply.
i'm not a programmer, i try to add this in Webform > Settings > CSS/JS:jQuery(document).ready(function() { // Get the autocomplete element and the textfield element. var autocompleteElement = document.getElementById('edit-username-autocomplete'); var firstNameElement = document.getElementById('edit-field_first_name'); // When the user selects a username in the autocomplete element, // update the first name element with the user's first name. autocompleteElement.addEventListener('change', function() { var username = autocompleteElement.value; var user = Drupal.user.load(username); if (user) { firstNameElement.value = user.field_first_name; } }); });
But i got this error in console:
Uncaught TypeError: Cannot read properties of undefined (reading 'load')
at HTMLInputElement.I hope you can help ;-)
and thank you again.
For help with programming, look into the resources I provided in comment #2.