Pound sign in text box prevents selection left-to-right

G

Guest

Using IE6 & IE7, if the first character in a text box is a pound sign (#),
then any characters that follow can not be selected normally with the mouse
(left-to-right drag). To ensure it wasn't my site, I tried it at
microsoft.com and ibm.com. Used the search box on the opening page in both
cases.
Some notes:
-- right-to-left selection works, as does clicking an insertion point,
holding down shift, and clicking an endpoint for the selection.
-- text can be selected (both directions) using shift + the keyboard arrows
-- adding a second pound sign later in the text box makes everything
selectable

Any ideas/explanations?
 
R

Rob ^_^

Hi Lens,

I can confirm you observations, also effected are "$","%","*","^", ... etc,
except "+". These are all 'escape' characters.
Firefox and Opera are unaffected.
Interestingly I use onfocus="this.select();" and this still works when one
of these characters is present in the textbox receiving focus.

I recently came across a problem for a web site that I was working on, which
did a database full text query and these failed if the search string
contained just one of these characters also. Our quik fix for this was to
remove these keys in the textbox keyup event.

Regards.
 
G

Guest

Hi Rob,

I appreciate your observations. In my particular case, I want to allow users
to select/edit in any portion of the text box contents. Hex color codes are
what's in there. I can avoid all this by not putting the pound sign in the
text box, then adding it programmatically, but I have other reasons for
having it there.

The user also has a JS color picker at their disposal that keeps this from
being a showstopper. I guess if the user has enough experience to edit the
hex codes directly, they can probably figure out to drag right-to-left in IE.

Better yet, if they have enough experience, they're probably using FireFox.

Thanks again,
Len
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top