LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-04-2002, 09:12 PM
dv8's Avatar
dv8 dv8 is offline

Admin Mod
 
Join Date: Mar 2001
Posts: 2,053
Rep Power: 15
dv8 is on a distinguished road
Fix Limit Fields in HTML Forms

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();
		}
	}
}
Usage:
<input type="text" name="field1" onKeyUp="check(this)">
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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




All times are GMT. The time now is 10:53 AM.