tabindex

Hi,

is there any possiblity to set the “tabindex” on the fields? If yes, can someone let me know this please. :question:

I use the object init in the moment for this form.

{type: "fieldset", name:"kontaktdaten", label: "Kontaktdaten", width: 600, list: [ {type: "settings", position:"label-top", labelWidth: 250, inputWidth: 250}, {type: "block", width: 250, list: [ {type: "select", label: "Anrede", name: "anrede", options:[ {text: "Herr", value: "herr"}, {text: "Frau", value: "frau"} ]}, {type: "input", name: "vorname", value:"", label: "Vorname", validate: "NotEmpty", tabindex: 1}, {type: "input", name: "strasse", value:"", label: "Strasse / Nr.", validate: "NotEmpty"}, {type: "input", name: "plz", value:"", label: "Postleitzahl", validate: "NotEmpty"}, {type: "select", label: "Land", name: "land", options:[ {text: "Deutschland", value: "deutschland"}, {text: "Österreich", value: "oesterreich"}, {text: "Schweiz", value: "schweiz"} ]}, {type: "input", name: "email", value:"", label: "E-Mail", validate: "ValidEmail"}, ]}, {type: "newcolumn", offset: 15}, {type: "block", width: 250, list: [ {type: "select", label: "Titel", name: "titel", options:[ {text: "---", value: "empty"}, {text: "Dr.", value: "dr"}, {text: "Prof.", value: "prof"}, {text: "Prof. Dr.", value: "profdr"} ]}, {type: "input", name: "nachname", value:"", label: "Nachname", validate: "NotEmpty"}, {type: "input", name: "zusatz", value:"", label: "Zusatz"}, {type: "input", name: "ort", value:"", label: "Ort", validate: "NotEmpty"}, ]}, ]},
I do a lot of things but all the time i get an error or nothing.

I want to jump from the field “Vorname” to “Nachname” and then to “Strasse / Nr.” and so on. See picture

Thanks,
Björn

What version of dhtmlxForm do you have?

Hello sematik,

i use 3.0 from the following post
http://forum.dhtmlx.com/viewtopic.php?f=17&t=18643

Hello,

there is not a built-in method to set tabIndex. However, it is possible using the following approach:

  • define getInput method:

dhtmlXForm.prototype.items.input.getInput= function(item) { return item.childNodes[1].childNodes[0]; }

  • get object of an input
var inp1 = myForm.doWithItem("your_input", "getInput");
  • define tab index
inp1.tabIndex = 2

Hello Alexandra,

thanks a lot for your help. This works fine. :stuck_out_tongue: