Is it possible to focus the center of text box?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Is it possible to focus the center of text box?

Post by vinoth »

Hi.

I am working with PHP & Javascript functions.

While clicking the text box, It will clear the contents of the text box by(onFocus="doClear(this)) and the cursor blink at the left side of the box..

Is it any possible way to make blink the Cursor on center of the box or 2nd position of the Box?

Please suggest, guide me to Do this

Thanks in advance
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Is it possible to focus the center of text box?

Post by Eran »

Add 'text-align:center;' to the style declaration of the input in question.
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Re: Is it possible to focus the center of text box?

Post by vinoth »

hi pytrin,

Thanks for your suggestion,

Its working fine
Post Reply