Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TEXTAREA trouble

Status
Not open for further replies.

calista

Programmer
Jan 24, 2001
545
US
One of my users found this interesting problem. He was trying to edit a TEXTAREA on one of my forms, and sometimes it would kick him back to the previous page. This would occur when he tried to backspace at the edge of the field. We finally figured out that if the cursor wasn't exactly in the box, it treated his backspace like hitting the "Back" button. If he then hit "Forward", it took him back to his form in the same state in which he left it. Upon further experimentation, we discovered that if you hit "Backspace" when your cursor is anywhere except inside a form field, it treats it like the "Back" button. Is there some way to disable this except for the actual "Back" button on the toolbar? Or, is there something else I can do about it?

This user is a great guy, but if there is any wierdness at all, he'll find it. Calista :-X
Jedi Knight,
Champion of the Force
 
Hey Calista,

I would experiment around with your textarea's "wrap" attribute and see if one setting or the other makes a difference. You could try wrap="physical" or wrap="hard" and see if that helps. You could also try catching the backspace key with Javascript and see if intercepting the value stops the buggy behavior.

Good luck,
GJ
 
I am using WRAP="Hard". I will try "Soft" and "Physical" to see what happens. As far as Javascript, my knowledge of it is limited to the fact that I know it exists. If you can help me out with some code, I would appreciate it. Calista :-X
Jedi Knight,
Champion of the Force
 
Hi Calista

I can't tell you the exact code, but here's a start. IE uses
window.event.which, NS uses window.event.keyCode.

<input type=&quot;text&quot; size=&quot;10&quot; name=&quot;X&quot; onkeypress=&quot;if (event.which == 13) { alert(); }&quot;>

Now, i understand what you're trying to do is catch the event when the focus is the window and not a form field... so you would need to catch the event generally.

Ill look into this next week if I have some time.. id suggest posting in the javascript forum you need to catch an event of backspace when the focus is not in a form field.

hope we can do this, i know exactly the issue you're referring too.. although im not a big fan of taking user functionality away.. but i know its hard to expect some users to ever be happy, god forbid we tell them to watch where the heck they are typing.

Something else you should check is the order of your form fields, and if any links or other elements that can hold focus lie between two form fields. Tabbing out of one onto a link can be confusing if you thought you were going to tab into a textarea.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top