Tutorial Details
- Judul: form Counting and Limiting using Javascript
- Difficulty: Beginner
- Platform: Javascript
- Bahasa Scripth: Javascript
- Software : Notepad++
- Estimated Completion Time: 15 minutes
- Created:Ricko Nada (Pustaka Flash)
live demo :
Scripth yang digunakan :
javascript
<script language="javascript" type="text/javascript"> var maxAmount = 250; function textCounter(textField, showCountField) { if (textField.value.length > maxAmount) { textField.value = textField.value.substring(0, maxAmount); } else { showCountField.value = maxAmount - textField.value.length; } } </script>
HTML
itulah sekiranya tutorial <form> <textarea name="ta" rows="6" style="width:340px;" onKeyDown="textCounter(this.form.ta,this.form.countDisplay);" onKeyUp="textCounter(this.form.ta,this.form.countDisplay);"></textarea> <br> <input readonly type="text" name="countDisplay" size="3" maxlength="3" value="250"> Characters Remaining </form>
5 Halaman yang sering dikunjungi:
0 komentar:
Post a Comment