Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

set font for textarea

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
what is the syntax to set font for a textarea.like i want to display indian language characters in the textarea.please provide the syntax
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You would, of course, have to know the name of the font you want to use, and it must be supported by the browser.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bodie,
I dont know js very well but the reference I use doesnt have a property called style for any object. could you give me a link to a tutorial or something that explains? This reference gives 5 properties of textArea defaultValue, form, name, type and value
D'oh maybe it is vbscript?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope, the style property is part of Cascading Style Sheets (CSS). There are a bunch of different ways that you can apply this stuff.
Using Style sheets:

you define a "style" that you want to apply in several different places. Then you only have to set your HTML object's Class attribute to apply the style. Like this:

This applies the style defined by your .text entry in the style sheet to the TD in question.
You can also do this using the style attribute of an HTML element if the style isn't going to be widely reused. Like this:

The third way that I use styles is through DHTML. You get a reference to an object, either by creating it in JavaScript or by using JavaScript to get a reference to an existing object. Then you use the style property of the object to modify its style. Like this:

You have to be careful, because the properties of a style sheet have different names in DHTML than they do in HTML. Notice that in HTML the property is called font-weight, but in DHTML it is called fontWeight.
That's my $.02 on CSS.
 
Randall Twede
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks bodie,
the first 2 examples are familiar to me but none of the tutorials on ccc, js or dhtml that i have read have mentioned using a style that way. such a powerful tool too
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic