Yes That did fix it.

Thanks for all the help.

On Mon, Apr 27, 2009 at 4:12 PM, Nathan Andelin <nandelin@xxxxxxxxx> wrote:


Nick,

see how the HTML element ID is "form1:ssn?" but the parameter autotab() is
"ssn?". Try adding the "form1:" prefix to the function parameter.

I can now see why document.getElementByID('ssn?') would fail. The IDs
don't match.

Nathan.




----- Original Message ----
From: Nick Arndt <nick.arndt@xxxxxxxxx>
To: Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>
Sent: Monday, April 27, 2009 2:49:55 PM
Subject: Re: [WEB400] auto tab between jsf form fields

Here is the generated HTML with my updated script

HTML

<td bgcolor="white" colspan="2" width="335">

<input id="form1:ssn1" type="text" name="form1:ssn1" class="inputText"
maxlength="3" onkeyup="autotab(event,this, 'ssn2');" size="3" />-

<input id="form1:ssn2" type="text" name="form1:ssn2" class="inputText"
maxlength="2" onkeyup="autotab(event,this,'ssn3');" size="2" />-

<input id="form1:ssn3" type="text" name="form1:ssn3" class="inputText"
maxlength="4" size="4" /></td>

Script
function autotab(e, original, destination) {
var evtObj = window.event ? event : e;
var code = evtObj.which ? evtObj.which : evtObj.keyCode;
if (code == 9 || //tab
code == 16 || //backtab
code >= 37 && code <= 40 || //arrow keys
code == 45 || //insert
code == 46 || //delete
evtObj.shiftKey) //shift
{
return false;
} // no autotab on tab/backtab/insert/delete/shift

if(original.getAttribute &&
(original.value.length==original.getAttribute("maxlength"))) {
elem = document.getElementById(destination);
elem.focus(); *** It looks like it does not like
this line when I get the error when running the page ***
}
}
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.