View Full Version : sound when reach maxlength of the input field - urgent!!!
therry
06-26-2002, 04:04 AM
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 ?
QuackHead
06-26-2002, 04:26 AM
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
therry
06-26-2002, 07:47 AM
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;">
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.