Copy link to clipboard
Copied
Hi,
Would like to know how can add an event listener that deletes a default value in the input form?
For example: I set default value to enter zip code and when the user clicks the input field to type the number it deletes the data and puts the cursor to the beginning.
Also, is there a way to set focus to the form after some time? I partially have made this work with this code.
document.getElementById("zipCode").value = "";
document.getElementById("zipCode").focus();
Problem it doesn't work 100% all the time, sometimes just clears the input form but leaves blank with no cursor ready to type especially on ios safari/iphone.
Thanks,
Rodrigo
Sorry for the delay in getting any reply. We're scouring the forums looking for ones that have been missed!
I haven't had to do what you're asking about, but wondered whether using .click() would work for the selecting after some time. Then the field should get selected in the way that is right for that platform:
There is also the click listener, to know when the user did that click:
That wouldn't account for tab though, but onfocus() would, and m
...Copy link to clipboard
Copied
Sorry for the delay in getting any reply. We're scouring the forums looking for ones that have been missed!
I haven't had to do what you're asking about, but wondered whether using .click() would work for the selecting after some time. Then the field should get selected in the way that is right for that platform:
There is also the click listener, to know when the user did that click:
That wouldn't account for tab though, but onfocus() would, and might mean you don't need the click listener:
Find more inspiration, events, and resources on the new Adobe Community
Explore Now