HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 27th, 1999, 04:43 PM
Adriano Pereira
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I need some help to perform a "jump" from one field to another in a form.
My problem is: i should to do this after first field validation (if size = 11, then jump).
Actually, I'm using the OnKeyPress first field event, to run this javascript function:
---------------------------------------------
FieldSize = document.forms[0].EdtField1. value.length
if ( FieldSize == 11)
{
alert( "I will jump to field 2" );
document.forms[0].EdtField2.focus();
return true;
}
return false;
---------------------------------------------
However, using Internet Explorer 4, I got a value of 10 for 'FieldSize', and using Internet Explorer 5, I got 11!!!

One more thing: when I lose first field focus (user press TAB or something like that), I checked if this field already have 11 chars, using the 'OnFocus' event from second field (can't use 'OnBlur' in this case) to run this code:

---------------------------------------------
strField1 = document.forms[0].EdtConta.value;
if ( strField1.length != 11 )
{
alert("Field1 must have 11 chars!");
document.forms[0].EdtField1.focus();
return false;
}
return true;
---------------------------------------------
In this case, using IE4 and IE5, I got strField1.length = 11 when the first field really have 11 chars... but using NETSCAPE, I got 10!!!!

What's happen???

Thanks all.

------------------
Adriano Pereira
(apereira@hsbc.com.br)
(adrianop@cwb.matrix.com.br)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Jumping Fields in a Form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT