l can't believe l forgot how to do this, l remember it was easy, and thats about it
.
l need something that will make a text box that is scrollable, but the viewer of the page can't enter any text into it, only the stuff l provided is displayed
. How can l do this? Oh, and i needs to be able to display html properly, cause there is no way l am going to go and format all of the text l need to put in here
.
XHTML:
| Code: |
| <textarea readonly="readonly"></textarea> |
Old HTML: (Just for reference, you shouldn't use this)
| Code: |
| <textarea readonly></textarea> |
Just don't put a </textarea> tag in it!
Ya, l've used the text only part, but there is a ton of HTML in here that needs to be displayed (just used for placement, but theres alot of it) how can l make it so that it allows HTML inside of it?
replace '<' with '<'. You may also wish to replace '>' with '>' though just the former should work.
Other things to change if they dont work
& / &
" / "
And that will allow me to put HTML inside the text field? How does that work out?
displays it as html rather than parsing it as html! 
But that won't work... By doing that, it'll just display "<b>Hello</b>" instead of displaying "Hello" in bold. I have no idea how you can do that though... Instead of a text area, can't you just use a frame, and another html file? If you want the scrolling part, you could just limit the size of the frame.
For example:
| Code: |
<frameset cols="100" rows="100" border="0">
<frame src="*the external html file*"/>
</frameset> |
That would give you a texbox-like thing, with html.
no good with the > and <
. Also, l'm on Myspace.com for it, so l can't have frames, any other suggestions?
Try using an iframe. You can specify the size, so it will exactly look like a textbox. Specify your HTML file in the src= property, and it will be readonly by default. Plus your page will not use frames.
Once again, myspace does not allow frames
What you want to do is use a rich text editing box. Please note that many browser don't support it. Opera 9, IE5+, NN 7.1+ and FF 0.6.1+ support it. Other's don't. Don't know about konquerer, Safari and rest...
See it here: http://www.kevinroth.com/rte/demo.htm ...
oh sorry I thought you wanted to show raw html
anyway I's use a simple div or table. Set the height property and overflow to either scroll or auto.
| KHO wrote: |
| Once again, myspace does not allow frames |
An iframe is not a frame actually. No <frameset> needed, just put the <iframe> tag in the <body> section, as you would do with an image. Give it a try at least!
an iframe is an 'Inline Frame' so it is a frame and is usually also blocked by most free webhosts for the same reasons normal/standard frames are.
| mathiaus wrote: |
| an iframe is an 'Inline Frame' so it is a frame and is usually also blocked by most free webhosts for the same reasons normal/standard frames are. |
Sorry, didn't know that... I thought only frameset pages were forbidden.
Anyway, I have checked www.myspace.com, and it seems to be a profile- and fansite hosting rahter than normal web hosting.
I think that mathiaus is right; An div section with overflow might be what you want...
Here's an example:
| Code: |
<div style="width: 100px; height: 100px; overflow: scroll">
Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here. Text goes here.
</div>
|
You can also change the overflow property to visible, hidden, auto, or inherit.
Wow this is really great.
I was looking for exactly something like this.
Using a frameset gives me headache cause it's really annoying to refrence objects in the other frame or parent. One frame structure looks like much better.
Now i can replace many subframes with this tag. I don't like to use iframe either cause it behaves independently. it can not share the javascript code functions.
thanks alot!