I'm building a website where my users will have to enter their code quite often. Along with other data (title, tags) the user will enter anywhere from one line of code to an entire block of up to 100 lines of code.
The truly crappy part about writing code on web based forms is that when you try to do tab indentations your cursor jumps to the next input field. This makes formatting your code into a readable block nearly impossible. I know this is avoidable if you use some fancy markup techniques, but then users can't simply copy and paste their code into my textarea.
So, I wrote some javascript that hooks user's keystrokes, and if it was a tab it stops it from moving to the next input, and enters a tab character. It works absolutely perfectly, aside from one flaw. Now, when I am moving through my input form, it seems unnatural, because I can't tab to the next field.
Here's an example of exactly what is happening: http://jsfiddle.net/uu9ft/1
Obviously, I can't have both, so which is better? Tabbing for indentation in code, or tabbing to move to the next field?