/    Sign up×
Community /Pin to ProfileBookmark

Changing font when certain character is used

I’m trying to create a sudo-syntax script so when I user types particular characters the font color(or size)changes. For example, in the text box if they typed a { in the following:
The sky is [COLOR=”Red”]{cloudy and dark}[/COLOR] but it is still warm.

or

The sky is [SIZE=”5″]{cloudy and [SIZE=”6″]{dark}[/SIZE]}[/SIZE] but it is still warm. (recursive)

So every time { is used it changes the font, and when } is used it moves it back to the previously used font.

Strange examples I know, but if I can figure this out I can continue on. I will also be using php with it. This has to work when they user either types it into the text box, or pastes it. Anyone familiar or have ideas for this?

Thanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@slaughtersDec 10.2009 — Do text boxes (I assume you mean <textarea>) even allow for formatting?

I thought only text was allowed.
Copy linkTweet thisAlerts:
@magicashauthorDec 11.2009 — Hmm, well what is being used when we type forum posts? Is it not a textarea box?
×

Success!

Help @magicash spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...