Cursor in a textarea

L

Linda

Is there a way to script the appearance of the cursor in a textarea?
Rather than a blinking cursor, I want to have an image.

Thanks,
Linda
 
J

Jukka K. Korpela

Linda said:
Is there a way to script the appearance of the cursor in a textarea?
Rather than a blinking cursor, I want to have an image.

Cursor appearance is something that you can set (or, actually, just suggest)
in CSS, e.g.

textarea { cursor: url(mycursor.cur); }

Browser support is still limited and generally limited to some image
formats.

You can of course set the cursor property in JavaScript, but there's nothing
special about it, as compared with setting style properties in general.
 
N

nick

Cursor appearance is something that you can set (or, actually, just suggest)
in CSS, e.g.

textarea { cursor: url(mycursor.cur); }

I think she wants to control the look of a text cursor, not a mouse
cursor... i.e., the vertical blinking line in the textbox.

Linda: AFAIK this is not possible in any straightforward or widely-
supported kind of way.
 
T

Thomas 'PointedEars' Lahn

Jukka said:
You can of course set the cursor property in JavaScript, but there's
nothing special about it, as compared with setting style properties in
general.

It would be better, if not correct, to say "_with_ JavaScript" instead,
because (Mozilla.org) JavaScript is but one of many languages with which
implementations of DOM APIs can be used, whereas implementations of W3C DOM
Level 2 Style CSS are _not_ part of the programming language. Other
examples include other ECMAScript implementations like Microsoft JScript,
Google V8 JavaScript, Apple JavaScriptCore, Opera ECMAScript, Konqueror
JavaScript; and Java.

<http://www.w3.org/TR/DOM-Level-2-Style/Overview.html#contents>


PointedEars
 
L

Linda

I think she wants to control the look of a text cursor, not a mouse
cursor... i.e., the vertical blinking line in the textbox.

That is correct.
Linda: AFAIK this is not possible in any straightforward or widely-
supported kind of way.

In particular, it will only be on an iPad and so for Mobile Safari.


Linda
 
T

Thomas 'PointedEars' Lahn

Linda said:
[nick wrote:]
I think she wants to control the look of a text cursor, not a mouse
cursor... i.e., the vertical blinking line in the textbox.

That is correct.
Linda: AFAIK this is not possible in any straightforward or widely-
supported kind of way.

In particular, it will only be on an iPad and so for Mobile Safari.

You should have asked in comp.infosystems.www.authoring.misc instead.

Anyhow, what you ask for is probably possible with considerable effort (and
probably way over your head ATM), but not user-friendly. Therefore, please
forget that idea. TIA.


PointedEars, iPhone user

P.S.: <http://jibbering.com/faq/#posting> pp.
 
L

Linda

You should have asked in comp.infosystems.www.authoring.misc

I will do that. Thank you.
what you ask for is probably possible with considerable effort

Effort does not matter. Results matter. I didn't ask if there was a
simple way.
(and probably way over your head ATM)

Obviously or I would have done it without asking for advice first.
please forget that idea

Maybe...First I will investigate.

Linda
 
T

Thomas 'PointedEars' Lahn

Linda said:
[Thomas 'PointedEars' Lahn:]
You should have asked in comp.infosystems.www.authoring.misc

I will do that. Thank you.

You're welcome. But please learn to quote properly.
Effort does not matter. Results matter. I didn't ask if there was a
simple way.

Usenet is not what you asked for.
Obviously or I would have done it without asking for advice first.

Obviously it did not occur to you that there is the possibility to try
something first and then ask.

Please read said:
Maybe...First I will investigate.

It is rather unlikely that the advice in ciwam or other pleaces where
serious Web developers read will be any different than this.


PointedEars
 
A

Asen Bozhilov

Linda said:
Thomas 'PointedEars' Lahn wrote:

Effort does not matter. Results matter. I didn't ask if there was a
simple way.

If I see similar textarea like yours, I will close the page and gone
away. Perhaps that is idea of some designer which want to F**K the
devil in the air? As Thomas pointed out, do not do that, because you
will break the expected behavior from user. That can confuse the user
and break usability of your page. For example I hate custom
implementation of form controls, especially when they are not provided
the same behavior as native components.
Maybe...First I will investigate.

Just like my PM's. They investigate the time, moneys, efforts for
stupid things. Please do it web instead of graphic images.

Regards.
 
N

nick

If this can even be done in js, the "extreme effort" would probably
involve some extreme hackiness.

ISTM the look of a cursor in a textbox is determined at a below
browser javascript, like at the level of the platform the browser runs
on... The cursors in all the GTK applications look pretty much the
same, same goes for QT, .NET, etc.

I have the feeling you'd have to make the change at an equivalent
level with Cocoa or whatever the iPad uses to do this the right way.
That means you'd have to come up with your own textbox control using
your own custom cursor drawing code, compile safari with your new
textbox control, and get Apple to approve your custom safari for your
app... Probably not going to work, but who knows.
If I see similar textarea like yours, I will close the page and gone
away. Perhaps that is idea of some designer which want to F**K the
devil in the air?

Hahah, I love it :D
As Thomas pointed out, do not do that, because you
will break the expected behavior from user. That can confuse the user
and break usability of your page.

Unless it's really an app and not (supposed to seem like?) a web
page...
For example I hate custom
implementation of form controls, especially when they are not provided
the same behavior as native components.

Sometimes it can be alright... those auto-complete search things
aren't so bad, and something like an integer-only textbox, not
allowing any character to appear besides a number or dash could be ok.
I've seen some annoying ones too though, so I know what you mean.

<snip>

Actually now that I think about it wasn't there an easily-reproducible
bug in firefox ~1.5 that would make your cursor disappear when certain
elements were absolutely positioned or something? You could switch to
that browser and exploit the bug... that's probably the best shot
you've got with javascript :p

-- Nick
 
M

Michael Haufe (\TNO\)

Is there a way to script the appearance of the cursor in a textarea?
Rather than a blinking cursor, I want to have an image.

Not directly as it is a native OS component. You'll have to emulate
the effect in another way. One approach is to do what Bespin does in
their code editor (https://bespin.mozillalabs.com/). Another approach
is to use a contenteditable tag and capture all key events to simulate
a textarea with the appearance you want. Whatever way you go, the code
won't be very straightforward.
 
L

Linda

nick said:
the look of a cursor in a textbox is determined at a below browser javascript

That is what I needed to know rather than...
forget that idea and
probably way over your head

Or said:
If I see similar textarea like yours, I will close the page and gone away.

No problem with that. The application would not be useful to you
anyway. It is for a niche market and will not be posted on the web.

And this:
Perhaps that is idea of some designer which want to F**K the devil in the air?

Cute. When you don't know how to do something, resort to juvenile
cursing...or the suggestion of cursing.

And this waste of time in your writing and my reading.
they investigate the time, moneys, efforts for stupid things.
Unless it's really an app and not (supposed to seem like?) a web page..
Not that it really matters, it in fact will be HTML, CSS and
JavaScript contained within a native iPad app. What is sometimes
called a hybrid app.
Sometimes it can be alright...like an integer-only textbox, not allowing any character to appear besides a number or dash

I agree. Especially on mobile platforms because it means less taps
when the letters and numbers are on different keypads.
You could switch to that browser and exploit the bug...
This is not possible. Only mobile Safari is available on the iPad. I
wish this were not true but it is a fact.

Thank you Michael for your comments as well.
Not directly as it is a native OS component.

Linda
 
B

Bwig Zomberi

Linda said:
This is not possible. Only mobile Safari is available on the iPad. I
wish this were not true but it is a fact.

Try Opera Mini. It was approved by Apple yesterday.

Form controls are difficult to customize. You could have a DIV and try
contenteditable property that Micheal suggested.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top