Mark Bran
asked on
change focus to another input .. not sibling input
Need to change focus from #zipCode input to #feelings input when #zipCode.maxLength === 5
assuming ofcourse #zipCode is not zero based if it is then maxLength 4
They are not siblings
not sure how to set an addventlistener for this assuming that is how I would go about it
assuming ofcourse #zipCode is not zero based if it is then maxLength 4
They are not siblings
not sure how to set an addventlistener for this assuming that is how I would go about it
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Leakim91 - your code blocks any editing of zipcode.
Also "input" handles paste
Also "input" handles paste
@zc2 - I can paste more than 5 chars into your field. You may want to crop the value or give an error
your code blocks any editing of zipcode.I was able to edit
you right, let's remove itAlso "input" handles paste
(In Chrome,) when I fill out the zip, I cannot edit it again because your click handler will move the focus because the field is full
Oh, I see, the jsfiddle do not have the click handler
thank you @Michel
Did you just edit my comment? Interesting
I would never do that. Which one ? It should be marked as "edited" I think.
I wrote
(In Chrome,) when I fill out the zip, I cannot edit it again because your click handler will move the focus because the field is full
and then I saw later it was converted to
----
Oh, I see, the jsfiddle do not have the click handler
----
which is not what I wrote and I would have written
Oh, I see, the jsfiddle does not have the click handler
(In Chrome,) when I fill out the zip, I cannot edit it again because your click handler will move the focus because the field is full
and then I saw later it was converted to
----
(In Chrome,) when I fill out the zip, I cannot edit it again because your click handler will move the focus because the field is full
Oh, I see, the jsfiddle do not have the click handler
----
which is not what I wrote and I would have written
Oh, I see, the jsfiddle does not have the click handler
Now it look like two from my last three comments is your.... the site is bugged?
@Michel Plungjan
JFYI, I reported both comments.
JFYI, I reported both comments.
ASKER
Just a follow up because of the additional comments ..... I am running the code input seems to be handling the paste issue
I pasted 9 numbers in it but it corrected it to 5 numbers then focus changed as I wanted it to the next input area
All is working well, with no issues so thanx again for the help it is much appreciated
I pasted 9 numbers in it but it corrected it to 5 numbers then focus changed as I wanted it to the next input area
All is working well, with no issues so thanx again for the help it is much appreciated
Open in new window