Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Animate CC Html5 Input component help

New Here ,
Sep 30, 2018 Sep 30, 2018

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

526
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 03, 2018 Nov 03, 2018

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:

HTML DOM click() Method

There is also the click listener, to know when the user did that click:

JavaScript DOM EventListener

That wouldn't account for tab though, but onfocus() would, and m

...
Translate
LEGEND ,
Nov 03, 2018 Nov 03, 2018
LATEST

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:

HTML DOM click() Method

There is also the click listener, to know when the user did that click:

JavaScript DOM EventListener

That wouldn't account for tab though, but onfocus() would, and might mean you don't need the click listener:

onfocus Event 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines