TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,965
  • Latest: boruko
Stats
  • Total Posts: 195,980
  • Total Topics: 21,320
  • Online today: 281
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 320
  • Total: 320

Code Box in html article not working

Started by Zetan, March 10, 2007, 06:50:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zetan

Hi, I'm trying to insert several images in an article, with the html to the image URL in code box below the displayed image.

Every time I save it, the article rips out half the html I inserted and displays the image and codebox below the article editor.

Hard to explain.

<a href="http://labradio.co.uk" target="_blank"><img src="http://i31.photobucket.com/albums/c399/LabDesign4632/LABRadioAvatarOrange.gif" border="0" alt="LAB Radio - Metal :: Alternative :: Rock"></a>

<br />

<textarea><a href="http://labradio.co.uk" target="_blank"><img src="http://i31.photobucket.com/albums/c399/LabDesign4632/LABRadioAvatarOrange.gif" border="0" alt="LAB Radio - Metal :: Alternative :: Rock"></a></textarea>


I would provide a screen shot, but photoshop is playing hard to get.

Very weird, it just won't accept more than one instance of it..
So, how do I display an image and have the code for people to copy underneath? And How do I size the code box?

Thanks



ZTN

JPDeni

The problem is with the closing


</textarea>


tag. You can't use one.

The page where you create your article has a form on it and the place where you enter your html is a textarea. When you enter the closing textarea code, the browser interprets it as being the closing tag for the article form and closes that textarea, effectively deleting anything after the tag.

So.... how to do it?

--Change the article to being a php article.

--Wrap your html code in an "echo" statement. That is, start with


echo '


and end with


';


You should be all right as long as you don't use any single quotes or apostrophes in your html text.

--Replace the closing textarea tag with the following:


</text' , 'area>


All you have to do is break up that tag and you'll be fine.

As for sizing the box, in the opening textarea tag add the number of rows and columns you want


<textarea rows="15" cols="30">


Experiment until you get the size you want.

Zetan

Okay, that seems to make sense, as that is exactly what it seems to be doing, conflicting with the article editor.
I'll have a go with the php article.

Thanks JPDeni.




ZTN



This website is proudly hosted on Crocweb Cloud Website Hosting.