Re: Editing in a text area field



On Jan 10, 4:24 pm, ro...@xxxxxxxxxxx (Ross McKay) wrote:
Nathan Rixham wrote:
HTML is a markup language used to describe the structure of a document;
presentation of HTML is controlled by either a client, with optional
instructions via attributes (bad) or css (good)

I almost agree, except that there are attributes that define the
behaviour of HTML elements that cannot be defined by css; such trivial
things as href, name, class, id, tabindex, maxlength, value, etc.

I know, I'm nit picking a bit...
--
Ross McKay, Toronto, NSW Australia
"Words can only hurt if you try to read them. Don't play their game" - Zoolander

What I do is to start by dealing with the escape issues with something
like this:

function escape_data ($data) {

// Address Magic Quotes.
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}

// Check for mysql_real_escape_string() support.
if (function_exists('mysql_real_escape_string')) {
global $dbc; // Need the connection.
$data = mysql_real_escape_string (trim($data), $dbc);
} else {
$data = mysql_escape_string (trim($data));
}

// Return the escaped value.
return $data;

}

and simply store the result. This gets rid of the stuff that might
interfere with my SQL queriesl

Depending on the output of the textarea (i.e. if you are using an
editor that processes the data in any way), I may translate the line
breaks appropriately. Sometimes htmlentities and html_entity_decode
can be useful in addition, depending on the output of the textarea.

The big issue I have found is with textarea WYSIWYG editors. I've
been using fckeditor. It gets the tags right about half the time.
This can be helped by creating custom styles and having your user
stick to these styles or removing all tags before making any changes.
Even then, it is not easy for the editor to get the nesting of styles
right. I suspect that the user doesn't even understand exactly how
they want them nested without understanding some basic html. Unless
they are looking at the source code, when they are highlighting text
to apply a style, there is no way of knowing if they are starting the
highlight before or after a certain html tag. This seems like an
endemic problem that can only be solved by raising the skill level of
users. It is always possible in fckeditor to look at the source code
and move tags around. If users are taught the basic logic of applying
div, span, p, em, and other simple tags, they can usually get them in
the right place. I name custom styles to meet purposes the users
understand and explain how these are applied using either and id or
class attribute.

Once this stuff is right, the data can be stuck in a table and
retrieved to place on a web page with simple data processing
functions.

One of the things I liked about the old word processor "WordPerfect"
is that it let you see a version of the file with all of the tab,
paragraph, underline, font and other tags made visible. Back then,
people who used this were able to go into a file and move these things
around to get them as they wanted. This is not much different than
dealing with html tags and WordPerfect users seemed to be able to do
this. Word makes all of this invisible (aside from a few tags like
paragraph and section breaks) and it is hard sometimes to get Word to
apply tags (especially list tags) the way I want them. Microsoft
always tries to dumb things down. I think it is appropriate to expect
users to develop some skills at what they are doing. This raises the
intelligence of the entire system and makes it easier for everyone to
communicate with each other.

--Kenoli
.



Relevant Pages

  • Re: Converting HTML to CSS
    ... HTML are predefined tags for laying out a page. ... Using CSS, you can configure how the tags are displayed. ... picture to the master page, the picture would show up in all the other pages. ...
    (microsoft.public.frontpage.programming)
  • Re: word webpages
    ... The ther are som tags with no closing tags DreamWeaver would remove what ever was causing these problems. ... Just create a simple document and save as HTML Make sure it has some type of formatting. ... XML all versions ...
    (microsoft.public.mac.office.word)
  • Re: I need a consensus (HTML - CSS)
    ... > I am trying to learn HTML and have obtained several books on the ... > as most of these books give me the basic tags and then say they will ... > soon be deprecated and advise using CSS stylesheets. ...
    (comp.infosystems.www.authoring.html)
  • Re: macro and cl-who help
    ... Lisp, but... ... you back into the "walking forms as HTML data" mode, ... This would have been extensible with user-defined tags, ... HTML tags are macros can be functions: ...
    (comp.lang.lisp)
  • Re: For anyone that cares...my new website....
    ... and all the links work. ... there are some "tags" in some pages that I have yet to clean up yet. ... I was experimenting with several HTML editors and learned the hard way that you can't get features from one editor to mix with features of another editor and back and forth. ...
    (sci.research.careers)