0

I have 3 Rate values in . Every time I want to change the values, I have to click on each box. Is there a way to click and change the first value, then press tab to go to the next span, hightlight/select the rate so I can just change the value and press tab to go to the next?

WriteHTML("<TD id='tdA1' runat='server'><span  tabindex='0' style=FONT-SIZE:11pt id='A1' runat='server'>" + Rate1 + "</span></TD>");
WriteHTML("<TD id='tdA2' runat='server'><span  tabindex='1' style=FONT-SIZE:11pt id='A2' runat='server'>" + Rate2 + "</span></TD>");
WriteHTML("<TD id='tdA3' runat='server'><span  tabindex='2' style=FONT-SIZE:11pt id='A3' runat='server'>" + Rate3 + "</span></TD>");

I tried nexttab="A2", it moved the focus to A2 when I pressed "Tab" but it did not select the value. When I am on A1 and press Tab, I want A2 to be selected so I can just type in the value and keep pressing tab to move to the next, just like in Excel spreadsheet. Thank you!

  • It might help if you include the rendered html. – mykaf Apr 27 '23 at 14:00
  • `` isn't an input element, so by default you can't *tab* to it. You can add `tabindex="1"` to the `span` and it will then accept tab. https://jsfiddle.net/tq1Lu3p9/ It looks like you've attempted this so that may not be your issue - instead it's likely the "did not select the value" part - it doesn't "select" the value, because that's not how it works. Try using an `` (which you can style to make it look less like an input) and then some js to select all on focus. – freedomn-m Apr 27 '23 at 14:15
  • 2
    Does this answer your question? [How do I make a element a regular tab stop within a form?](https://stackoverflow.com/questions/26154128/how-do-i-make-a-span-element-a-regular-tab-stop-within-a-form) - TLDR; use `tabindex="0"` – IT goldman Apr 27 '23 at 15:47

0 Answers0