Web Analytics Made Easy -
StatCounter sound when reach maxlength of the input field - urgent!!! - CodingForum

Announcement

Collapse
No announcement yet.

sound when reach maxlength of the input field - urgent!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • sound when reach maxlength of the input field - urgent!!!

    Hi,

    If I want to give a sound to alert the user that they are reaching the maxlength of the input text field when they are typing something in the text field.
    Can it be done using Javascript ?

  • #2
    I guess you could check the length of the field on every keypress...

    I'm not sure about playing a sound, you could sent an alert box though...

    I'll get back to you

    ~Quack

    Comment


    • #3
      Reply to Dave

      Hi Dave,

      I'm trying to use the code that u gave to me, but it's not working. Is it because in bgsound tag, the src I need to specify the location of my file, as well as for the document.all.ieSound.src='/sounds/Ding.wav' ?

      So, if I type more than 20 characters in this text field, the sound will de displayed, right?

      Can you explain a bit?

      Thanks


      Code :

      <bgsound id="ieSound" src="#" loop="1" autostart="true">
      <input type="text" size="20" onKeyDown="java script:
      if (this.value.length==this.size) {
      document.all.ieSound.src='/sounds/Ding.wav';
      return false;
      }
      return true;">

      Comment

      Working...
      X