
Welcome Guest
|
#1
|
||||
|
||||
|
I was bored today... monkeying with JavaScript.
Code:
// JavaScript
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input) index = i;
else i++;
return index;
}
function check (input) {
if (input.form[getIndex(input)+1] != undefined) {
if (input.value.length >= 30) {
input.form[(getIndex(input)+1) % input.form.length].focus();
}
} else {
if (input.value.length >= 30) {
input.form[(getIndex(input)) % input.form.length].blur();
}
}
}<input type="text" name="field1" onKeyUp="check(this)"> |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HTML5 Coding Tools and Resources to Help You Cut Through The Clutters of Coding | FlashMove | HTML 5 and Javascript | 0 | 11-26-2011 10:45 AM |
| importing xml with html tags into dynamic text fields | dvail67 | Flash CS3 / Flash 9 |
2 | 11-13-2007 08:43 PM |
| Email forms in flash or html? | bearuh | Newbies |
6 | 02-23-2006 01:18 AM |
| Forms in Flash better than HTML? | theoh | General Flash | 1 | 07-08-2004 07:32 AM |
| To embed fonts for use in HTML formatted text fields | Scottae | Flash MX ActionScript |
5 | 12-21-2003 08:15 AM |






