Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript function, please help me

    Hello,

    How to build a simple js function that, if a text field's max char is 10. Then, after the char on text field is reach 10, automatically pop out alert. Help me please.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,919
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Quote Originally Posted by apitmanu View Post
    Hello,

    How to build a simple js function that, if a text field's max char is 10. Then, after the char on text field is reach 10, automatically pop out alert. Help me please.
    As a general rule, the people helping out in this forum don't write code for others (especially code that appears to be for homework), but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.

    Hint: use onkeyup to check the length of the field.

    It is your responsibility to die() if necessary….. - PHP Manual
    Last edited by Philip M; 07-08-2012 at 09:32 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •