By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,106 Members | 2,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,106 IT Pros & Developers. It's quick & easy.

Javascript: changing how some part of an input text is displayed

P: 2
Hi forum,

In an input type=text, I would like to display the first ten characters being entered in bold, and the next one with the default style.

Is it possible to do this using Javascript, and how.

Thank you for your help,

adsm
Feb 1 '08 #1
Share this Question
Share on Google+
2 Replies


100+
P: 428
You need separate inputs, one class or set of style properties for each.

You can use css to make them appear to be one element, by containing them in a span styled to look like an input, and removing their borders.

javascript can move the focus to the next field by checking the length of the first field on keydown.
Feb 1 '08 #2

P: 2
Thank you for your great tip.
Feb 5 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.