Coding - returning the number of characters in a text box.


i in process of creating cell phone simulation/animation in edge animate cc use in captivate course. basically, when user clicks on number buttons on virtual keypad, displays numbers in text box , actual cell phone display phone number on screen caller dialing. so, user click 7 buttons , seven-digit phone number appears on virtual phone screen.  part of animation works great , 7 digits appear, modify code hyphen appears after third button clicked. way, output better resembles actual phone number instead of string of 7 digits.

 

here example of code have assigned #2 button on virtual keypad:

 

var text = sym.$("phonenum").html();

 

 

text = text + 2;

 

sym.$("phonenum").html(text);

 

 

phonenum name of text box on stage digits appear each keypad button clicked.

 

in order incorporate hyphen after third button clicked, need somehow return current number of characters in phonenum text box, create if/else scenario applies hyphen after third button clicked.

 

does know how can use either javascript or jquery return number of characters in phonenum text box?

sym.$("phonenum").text().length;



More discussions in Edge Animate CC


adobe

Comments

Popular posts from this blog

Thread: gpg: Conflicting Commands

Adobe Acrobat Pro , Terminal Server Use

when i try using AE CC 3d camera tracker after the first step it says "Analysis solve failed." help?