That also does not satisfy my need. I want the textfiled to accept tab key pressed and it will indent the text. when it comes to the end of statement it will also follow the indent of previous line indent. I will also able to justify the allignment of the text.
...onKeyDown event:<BR><BR>http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events/onkeydown.asp<BR><BR>And the docs there say you can cancel the TAB key via event.returnValue=false<BR><BR>So I would assume you could do what you wish.<BR><BR>But is it a good idea???<BR><BR>People used to HTML forms will *expect* to use TAB to get to the next form field, not to indent. Wouldn't you be better off to use some other key indent???
...there's no such thing as a "textbox" in HTML.<BR><BR>There are INPUT fields of type TEXT (which I call text fields, but I admit that many people call "textboxes").<BR><BR>And there are TEXTAREA's.<BR><BR>TEXT fields are *ONLY* one line. Period.<BR><BR>TEXTAREA's can be multiple line.<BR><BR>I have been assuming that you are talking about a TEXTAREA.<BR><BR>If not, then I don't understand the question.<BR><BR>*********<BR><BR>As for the indenting: That is *not* going to happen automatically. You will have to *intercept* the TAB key (using onKeyDown, as I noted) and insert spaces into the text of the TEXTAREA. That's not going to be trivial to do. You have to find where the cursor currently is in the text and insert spaces there. I'm not even sure you *can* do that. And if you can, then you might have to code differently for MSIE than for other browsers, such as NS 7.<BR><BR>You *REALLY* ought to look at Atrax's solution. An honest to goodness real text editor that runs in the browser. I dunno why you said that wouldn't work for you. Just because of the indent? <BR><BR>
Yeah, just because of the indent thing. I have tried to insert java script which detect the ened of the cursor and then insert spaces to the position but when i do so i don't know how to enable the user to continue writing from where the sentece ended as 'focus' will bring me back to the start of the statement.