Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > DHTML TabIndex Problem with <SELECT>

Thread Tools

DHTML TabIndex Problem with <SELECT>

Posts: n/a
Hi guys,

I have a pesky problem that I can't seem to shake. I am submitting a
form to an iframe, and on the iframe's onLoad I am replacing the
innerHTML of a <DIV> with a new select or input box.

Basically it works like this:
1)user changes CITY
2)user changes STATE
3)IFRAME runs a cgi exe and fills in the ZIPCODE div with either an
input box(if one zipcode was returned) or a select box(if several were

When an input box is returned, everything works perfect everytime.
When a select box returns and I set focus to it, the next tab takes me
to the address bar instead of the next element.

The active element stuff is to preserve my tabIndex incase the user
inadvertantly tabs into the field that is about to change before it
actually changes, it works properly.

Don't mind the functions being poorly structured. I thought that the
problem might have been a javascript order of events thing, but it
wasn't, and I left the functions the way they were for now.

There are no duplicate tab indexes.
I've tried parent.document.recalc();

Code Below:

var activeElement;
function getActiveElement()

function selectItem(anObject)
else if(anObject.tagName=='SELECT')

function setActiveElement()
{parent.document.getElementById(activeElement).foc us();
selectItem(parent.document.getElementById(activeEl ement));

function doLoad()
{parent.document.getElementById('ZIPCODE_DIV').inn erHTML='<INPUT
ONCHANGE="document.MAIN.DATAPARENT.value=\'ZIPCODE \';document.MAIN.DATAFIELD.value=\'CITY\';document\'COMM\';document.MAIN.action=\'getDa ta\';document.MAIN.submit();"
TABINDEX="13" TABORDER="13"id="ZIPCODE" class="gtsmallinput">';}


<BODY ONLOAD="try{'';getActi veElement();doLoad();setActiveElement();}catch(err ){alert(err.message)};">


Any help would be greatly appreciated.

Reply With Quote

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with using tabindex in formview samira455 ASP .Net 0 09-12-2006 12:18 PM
DataGrid problem with tabindex mac ASP .Net Web Controls 0 04-15-2005 11:04 PM
Do any DHTML books cover contemporary DHTML? Steve Javascript 1 04-09-2005 04:16 PM
Tabindex kai ASP .Net 2 01-09-2004 02:38 PM
TabIndex of DataGrids Ravikanth[MVP] ASP .Net 2 07-21-2003 04:09 PM