tabindex 不适用于联系表单(使用 Flash AS2)

发布于 2024-10-17 17:57:47 字数 2035 浏览 1 评论 0原文

我的网站上有一个联系表单,其文本输入是通过 AS2 创建的。这工作正常,但无论我做什么,我都无法使选项卡工作(甚至没有任何效果)。我有一个菜单,有时显示在顶部,有时显示在左侧,有时显示在底部。如果它在顶部或底部,那么表单选项卡工作正常,但是如果它在侧面,那么当我从 contact_namefield 选项卡时,它会转到第 8 个菜单选项,然后是第 9 个菜单选项,然后是 contact_emailfield,然后是 contact_messagefield。类似地,如果我从菜单顶部按 Tab 键,它会按顺序向下移动到菜单选项 7,然后到 contact_namefield,然后是菜单选项 8,然后是菜单选项 9,然后是 contact_emailfield,然后是 contact_messagefield。我一生都无法弄清楚如何改变这一点,我宁愿避免为页面上的每个其他元素设置 tabenabled=false (因为我仍然希望这些元素被标记),但无论如何我不认为这将修复它,因为我指定的制表符索引似乎根本没有影响,无论我输入什么值(即使我反转它们),制表符顺序始终完全相同。我正在使用以下代码,如果有人能指出我做错了什么,我将非常感激,因为我一生都无法弄清楚!

var currfont=_root.textfont;
var inputcol = "0x" + _root.textcolour;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = false;
my_fmt.font = "Arial";
my_fmt.color = inputcol;

createTextField("contact_namefield", getNextHighestDepth(),112.6, 29, 174, 20);
contact_namefield.wordWrap = true;
contact_namefield.multiline = false;
contact_namefield.border = true;
contact_namefield.borderColor = inputcol;
contact_namefield.type = "input";
contact_namefield.setNewTextFormat(my_fmt);
contact_namefield.text = "";
contact_namefield.tabEnabled=true;
contact_namefield.tabindex = 0;

createTextField("contact_emailfield", getNextHighestDepth(),112.6, 74, 174, 20);
contact_emailfield.wordWrap = true;
contact_emailfield.multiline = false;
contact_emailfield.border = true;
contact_emailfield.borderColor = inputcol;
contact_emailfield.type = "input";
contact_emailfield.setNewTextFormat(my_fmt);
contact_emailfield.text = "";
contact_emailfield.tabEnabled=true;
contact_emailfield.tabindex = 1;

createTextField("contact_messagefield", getNextHighestDepth(),112.6, 120.3, 174, 125.6);
contact_messagefield.wordWrap = true;
contact_messagefield.multiline = false;
contact_messagefield.border = true;
contact_messagefield.borderColor = inputcol;
contact_messagefield.type = "input";
contact_messagefield.setNewTextFormat(my_fmt);
contact_messagefield.text = "";
contact_messagefield.tabEnabled=true;
contact_messagefield.tabindex = 2;

非常感谢大家一如既往的帮助,

戴夫

I have a contact form on my site for which the text inputs are created via AS2. This works fine but I cannot get the tabbing to work (or even have any effect) no matter what I do. I have a menu that sometimes displays at the top, sometimes on the left and sometimes at the bottom. If it's at the top or bottom then the form tabbing works fine, however if it's down the side then when i tab from contact_namefield it goes to the 8th menu option, then the 9th menu option, then contact_emailfield then contact_messagefield. Similarly if i tab from the top of the menu it's goes down sequentially to menu option 7, then to contact_namefield, then menu option 8, then menu option 9 then contact_emailfield then contact_messagefield. I cannot for the life of me work out how to change this, I would rather avoid setting tabenabled=false for every other element on the page (as i'd still like these to be tabbed), but either way I don't think this will fix it as the tabindexes i've specified seem to be having no affect at all, no matter what values i put in (even if i reverse them) the tab order is always exactly the same. I am using the following code and would be so grateful if anyone could point out what i'm doing wrong as I can't for the life of me figure it out!

var currfont=_root.textfont;
var inputcol = "0x" + _root.textcolour;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = false;
my_fmt.font = "Arial";
my_fmt.color = inputcol;

createTextField("contact_namefield", getNextHighestDepth(),112.6, 29, 174, 20);
contact_namefield.wordWrap = true;
contact_namefield.multiline = false;
contact_namefield.border = true;
contact_namefield.borderColor = inputcol;
contact_namefield.type = "input";
contact_namefield.setNewTextFormat(my_fmt);
contact_namefield.text = "";
contact_namefield.tabEnabled=true;
contact_namefield.tabindex = 0;

createTextField("contact_emailfield", getNextHighestDepth(),112.6, 74, 174, 20);
contact_emailfield.wordWrap = true;
contact_emailfield.multiline = false;
contact_emailfield.border = true;
contact_emailfield.borderColor = inputcol;
contact_emailfield.type = "input";
contact_emailfield.setNewTextFormat(my_fmt);
contact_emailfield.text = "";
contact_emailfield.tabEnabled=true;
contact_emailfield.tabindex = 1;

createTextField("contact_messagefield", getNextHighestDepth(),112.6, 120.3, 174, 125.6);
contact_messagefield.wordWrap = true;
contact_messagefield.multiline = false;
contact_messagefield.border = true;
contact_messagefield.borderColor = inputcol;
contact_messagefield.type = "input";
contact_messagefield.setNewTextFormat(my_fmt);
contact_messagefield.text = "";
contact_messagefield.tabEnabled=true;
contact_messagefield.tabindex = 2;

Thanks so much for your help as ever everyone,

Dave

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

無心 2024-10-24 17:57:47

我发现这个线程正在寻找我的 tabIndex 不起作用的原因,这可能无法解决您的问题,但来自 adobe 网站:“tabIndex 属性必须是正整数”。你的第一个索引为 0,它是非负的,但不是正的。尝试从 1 开始。

I found this thread searching for a reason my tabIndex isn't working, and this may not solve your problem, but from the adobe website: "The tabIndex property must be a positive integer". Your first index as 0, which is nonnegative, but not positive. Try starting at 1.

风轻花落早 2024-10-24 17:57:47

它是 {tabIndex} 而不是 {tabindex}

var currfont=_root.textfont;
var inputcol = "0x" + _root.textcolour;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = false;
my_fmt.font = "Arial";
my_fmt.color = inputcol;
myTxt=["contact_namefield", "contact_emailfield", "contact_messagefield"];
createTextField(myTxt[0], getNextHighestDepth(),112.6, 29, 174, 20);
createTextField(myTxt[1], getNextHighestDepth(),112.6, 74, 174, 20);
createTextField(myTxt[2], getNextHighestDepth(),112.6, 120.3, 174, 125.6);

for (var x=0; x< myTxt.length; x++) {
    eval(myTxt[x]).wordWrap = true;
    eval(myTxt[x]).multiline = false;
    eval(myTxt[x]).border = true;
    eval(myTxt[x]).borderColor = inputcol;
    eval(myTxt[x]).type = "input";
    eval(myTxt[x]).setNewTextFormat(my_fmt);
    eval(myTxt[x]).text = "";
    eval(myTxt[x]).tabEnabled=true;
    eval(myTxt[x]).tabIndex = x;//or (x+1);
}

It is {tabIndex} not {tabindex}

var currfont=_root.textfont;
var inputcol = "0x" + _root.textcolour;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = false;
my_fmt.font = "Arial";
my_fmt.color = inputcol;
myTxt=["contact_namefield", "contact_emailfield", "contact_messagefield"];
createTextField(myTxt[0], getNextHighestDepth(),112.6, 29, 174, 20);
createTextField(myTxt[1], getNextHighestDepth(),112.6, 74, 174, 20);
createTextField(myTxt[2], getNextHighestDepth(),112.6, 120.3, 174, 125.6);

for (var x=0; x< myTxt.length; x++) {
    eval(myTxt[x]).wordWrap = true;
    eval(myTxt[x]).multiline = false;
    eval(myTxt[x]).border = true;
    eval(myTxt[x]).borderColor = inputcol;
    eval(myTxt[x]).type = "input";
    eval(myTxt[x]).setNewTextFormat(my_fmt);
    eval(myTxt[x]).text = "";
    eval(myTxt[x]).tabEnabled=true;
    eval(myTxt[x]).tabIndex = x;//or (x+1);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文