You are here: Re: Preload a TextArea « HTML « IT news, forums, messages
Re: Preload a TextArea

Posted by Jukka K. Korpela on 08/02/05 14:26

"Noel" <vbgooglegroups@yahoo.com> wrote:

> I have a textarea
>
> <textarea wrap="hard" name="comment" rows="10" cols="80"></textarea>

That's fine, except for the nonstandard and harmful attribute wrap="hard".
Use wrap="off" instead; equally nonstandard, but useful, since it makes
wowsers behave the way they are supposed to, in line wrapping (i.e., not
mess things up by line breaks _they_ introduce).

> which I want to preload by passing in some text in the URL, so I do
>
> www.myhost.com/enter_info.cgi?&comment=Line%20One

Stop wanting that.

If the content is a meaningful and useful default content for _user input_
(which is what textarea is for), use tools like CGI or PHP to insert the
external content, or copy it by hand. But I doubt whether name="comment" is
adequate then. If you are asking for a user comment, why would _you_ want
to write that comment, or even a default for it?

Did you really mean www.myhost.com? There's no reason why it could not be a
real domain, today or tomorrow. So if you actually meant a dummy domain,
use www.myhost.example or something similar; the .example pseudo-domain is
guaranteed to remain nonexistent. Better still, tell us the real URL.

> Now this puts "Line One" into my textarea.

Maybe, depending on what your undisclosed CGI script does.

> Is it possible to put another line below this e.g. "Line Two" so I see
>
> Line One
> Line Two
>
> in my textarea?

Of course. It all depends on your CGI script.

> So, basically, I've been trying to figure out is there some code for
> "new line" like the code %20 for a space?

I'm afraid you are basically confused. Why on &Planet; would you want to
write some complicated URL to have some simple text (passed in the query
part in an encoded format) inserted, instead of simply inserting the text?

> I can't alter the web page, I can only pass info the information using
> "comment=" in the URL.

_Which_ web page cannot be altered by you? Yours?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация