I have 2 text fields. I need to fill the value from the first text field into the second text field.
I managed to do this with the below code but the problem is that it does not work perfectly as I think I am using the keyup function.
What I mean is the second text field gets the value if a type in the value in the first text field but if I select a listing in the first text field as this is ajax enabled it does not work. Below is my code.
$('#edit-nodequeid').keyup(function() {
val = $('#edit-nodequeid').val();
$('#edit-container-name').val(val);
});
Below is a screen shot
pls help,
vishal
What exactly do you mean by “ajax enabled”, and the browsers auto complete/fill is not ajax?
It it is Ajax you can delegate the handler:
If the problem really is that the keyup event is not fired because no keys are pressed when selecting an autofill value, then just use another event, or multiple events, like so: