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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing font size of numbers not letters

Status
Not open for further replies.

thisanthrope

Technical User
Jul 1, 2003
7
US
Hi,

I'm not a coder but I'm forced to work with it on occasion. I operate as a admin a online print site where clients can enter in contact info to create imprint on promotional items.

I can plug in java in certain places to control some of the entry fields. The code I can write is pretty simple stuff for example to format dots instead of dashes for phone numbers like:
Code:
if (hasValue(curInput.name))
{
if (! AutoFormat(curInput, '###.###.####', 'Please enter your number in a 555.555.5555 format'))curInput.focus();
}
I have an issue where I need some code written to format an address field so that the letters are font size X and numbers are font size Y.

could get anyone to help me out?
 
I don't think there is any way you will ever be able to tell what font size the user was using when the entered their text.

The browser simply does not pass that info on from a text input field.

If you are using a rich-text editor, then that should be supplied in the markup.

Perhaps giving a bit more information might help?

Dan





Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
I create pdf templates with field placeholders |1.1|[address]

This template is uploaded to the print site which interprets the tags and makes them into variable fields for clients to enter in their info. The site can pull the font name, size, position, etc... from the pdf template.

For each info field that the site creates it also has an option to apply javascript to that field. So if the template predefines font size X, I just want to apply code that will affect only the numbers of the text that is entered.

hope this explains a little more better.....:)
 
perhaps string parsing (ick!!) to wrap numeric characters in one class and everything else in a different class?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top