close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

W3C Validation & HTML Editor

Thread began 2/18/2010 6:29 am by alistair316863 | Last modified 3/04/2010 4:48 am by alistair316863 | 1538 views | 12 replies |

alistair316863

W3C Validation & HTML Editor

Hi my boss is wanting all our sites to be fully W3C compliant which isn't a problem but most of the errors I am correcting are down to HTML Editor for instance W3C want a return to be <br /> if i change this in the editor and validate everything is ok but if i go back and alter some text the editor reverts back to <br> making it none compliant.

I also have the editor using mystyle sheets which again is great but, if for instance i have formatted my test using the default font size etc of the editor then restyle with my style sheet it will view correctly on my site but in the source of the text in the editor it is leaving the past styles in as well creating extra code that is not needed and causing it o fail validation.

Any tips or help with this will be much appreciated thanks Alistair

Sign in to reply to this post

Jason ByrnesWebAssist

the FCKEditor that ios used by HTMLEditor does not have a way to force <br /> tags instead of <br> tags, this is a limitation to the tool.


In the insert record behavior, you can use the replace function to replace any occurance of <br> to whith <br /> instead, the code would look like:

php:
<?php echo((isset($_POST["country"]))?str_replace("<br>""<br />"$_POST["country"]):""?>





Formatting can be toggled on or off. In other words if you set text to be bold, reelecting the bold format will remove it. For any format you wish to remove, you have to reselect that format to toggle it off.

Sign in to reply to this post

alistair316863

When you say the "insert record behavior" in which file would i find this do you mean in admin/contents_insert.php ? Regards Alistair

Sign in to reply to this post

Jason ByrnesWebAssist

yes, the insert record behavior is on the contents_insert.php page, you will probably also want to change it in the update record behavior on the contents_update.php page.

Sign in to reply to this post

alistair316863

Thanks Jason, I have inserted the line of code you gave me but nothing happened I have obviously put it in the wrong place can you be more specific and tell me exactly where i should put it below is where i did thanks Alistair


<?php echo((isset($_POST["country"]))?str_replace("<br>", "<br />", $_POST["country"]):"") ?>
<?php } // Show if recordset empty ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Sign in to reply to this post

Jason ByrnesWebAssist

do not insert this line of code into the page,


You need to edit the code created in the Insert Record server behavior.


Double click the insert record server behavior. Select the column that the HTMLEditor content is being stored in.

the value section will show code similar to:
<?php echo((isset($_POST["country"]))?$_POST["country"]:"") ?>



the name of the form element will be different. edit that code to include the str_replace functions:
<?php echo((isset($_POST["country"]))?str_replace("<br>", "<br />", $_POST["country"]):"") ?>

don't change the name of the form element though.

Sign in to reply to this post

alistair316863

Sorry Jason but i just cannot find the Insert Record server behavior, you are going to have to talk to me like a five year old because i just don't get it.

I have looked in the contents_insert.php for it but unless i am being really stupid (which is more than likely) I just cannot find it. regards Alistair

Sign in to reply to this post

Jason ByrnesWebAssist

you will need to have DataAssist installed to make this change.

Once you have DataAssist installed, go to window -> server behaviors.

In the list of server behaviors, double click the Insert record server behavior. Select the column that the HTMLEditor content is being stored in.

the value section will show code similar to:
<?php echo((isset($_POST["country"]))?$_POST["country"]:"") ?>



the name of the form element will be different. edit that code to include the str_replace functions:
<?php echo((isset($_POST["country"]))?str_replace("<br>", "<br />", $_POST["country"]):"") ?>

don't change the name of the form element though.

Sign in to reply to this post

alistair316863

Morning Jason thanks for he reply i have installed data assist and done as you said but still no joy have a look at the attached image and you will see that there wasn't any code that looked like yours i tried this with both the insert Record behaviors. Regards Alistair

Sign in to reply to this post

Jason ByrnesWebAssist

If you look at the screen shoot of step 2 of the data assist insert record behavior, the code for each column is similar to the code that posted, the difference is the name of the post variabel that is being referenced. The code I provided is an example using a form element named 'country'. you need to modify it to use the correct form element name for your purposes.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...