0

I'm using this solution https://stackoverflow.com/a/4932770/3108268

$("#EmailAddress").keyup(function(){
    $("#Username").val(this.value);
});

And it works fine when typing input values with a keyboard, it auto fills the selected field.

But it doesn't work when filling a field with a mouse click from calendar popup javascript plugin. The popup plugin gives the input classes hasDatepicker date-popup-init.

This is all inside Drupal 7, but I don't think it's relevant.

Here's an example, as you can see the time field is plain text and autofills below, because it is being filled with a keyboard while filling the date field with mouse click from calendar popup does not fill the field below it (but does if you force-type with keyboard).

enter image description here

1 Answer 1

1

You could use change event;

$( "#EmailAddress" ).change(function() {
  $("#Username").val(this.value);
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.