/    Sign up×
Community /Pin to ProfileBookmark

formating text in an array?

Is it possible to format text within a text array? eg sepearte lines of text and change font and size? Also how can text fields be changed so that they cannot be edited by the user?

I have tried html tags within the text array however they do not appear to work?

any suggestions would be much appriciated,

cheers,

ben.

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@FangJan 26.2005 — You can format text in a text array, but it will not be applied to form elements.

Add [i]readonly[/i]:

<input type="text" value="xxxx" readonly="readonly">
Copy linkTweet thisAlerts:
@benji_stylerauthorJan 26.2005 — Thank you. So is it possible to seperate lines of text in an array? I am loading text values from an array into a text field which is a form object. The text in my array is currently all squashed together. I want to be able to seperate specific lines.

At the moment an element in my array looks like:

text[0] ="Carrera GT: Engine - 5.71 V10 engine, 425 KW (612bhp) at 8000 rpm - Perfomance - Top Speed = 205mph, 0-60mph in 3.9 seconds - Price - Recomended Retail Price £318,000.00 incl. VAT"

I want it to be displayed within the text filed so that it looks like:

Carrera GT:

Engine - 5.71 V10 engine, 425 KW (612bhp) at 8000 rpm

Perfomance - Top Speed = 205mph, 0-60mph in 3.9 seconds

Price - Recomended Retail Price £318,000.00 incl. VAT

Is this possible?

cheers,

Ben.
Copy linkTweet thisAlerts:
@scragarJan 26.2005 — you could display it in a textarea, but then you'd lose the read only property...

you could try an onchange to set it back to it's initial value so everytime it changes it gets switched back, but that's risky.
Copy linkTweet thisAlerts:
@FangJan 26.2005 — A line-break in a textarea is [COLOR=blue]n[/COLOR]

text[0] ="Carrera GT[COLOR=blue]nn[/COLOR]Engine - 5.71 V10 engine, 425 KW (612bhp) at 8000 rpm[COLOR=blue]n[/COLOR]Perfomance - Top Speed = 205mph, 0-60mph in 3.9 seconds[COLOR=blue]n[/COLOR]Price - Recomended Retail Price £318,000.00 incl. VAT"
Copy linkTweet thisAlerts:
@benji_stylerauthorJan 26.2005 — thank you that has solved my problem. If your interested here is my finished image gallery its all about Porsche. heres the link:

http://myweb.tiscali.co.uk/benji_styler/imagegallery/bensimagegallery.htm

All i need to do know is a preloader function.
Copy linkTweet thisAlerts:
@scragarJan 26.2005 — just load all the images and then set their height's to -1 from javascript, then when your site load the images will appear to load inatantaniously although your not loading them, your just restoring their height properties.
Copy linkTweet thisAlerts:
@benji_stylerauthorJan 26.2005 — that would be easier but my assignment requires me to use a preloader function which im unsure of? As i have 2 arrays does that mean i need 2 different preloader functions?

cheers,

ben.
Copy linkTweet thisAlerts:
@David_HarrisonJan 27.2005 — I just gotta say, damn they're nice cars. :p
×

Success!

Help @benji_styler 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.19,
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,
)...