Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been giving my dev team grief by checking in HTML edited in DW. It turns out that DW has silently been rewriting all instances of 'onclick' to 'onClick' completely breaking the application in Webkit on us.

I've done some digging on Google and this appears to be a bug that goes back to at least 2004. Supposedly it has nothing to do with your code re-writing settings and what triggers it is opening any document that does not contain a Doctype. Few of ours do, given that we're maintaining a framework that's using all sorts of include and dependency files.

In all my Googling, I haven't found a fix, though. Has anyone come across one short of swearing off Adobe products forever?*

  • something, btw, that I'm perfectly fine's just that given the insane IT lockdown on our work machines, we have very few software choices. For now, It's Notepad++ for me.
share|improve this question

migrated from Mar 16 '11 at 4:49

This question came from our site for professional programmers interested in conceptual questions about software development.

What version of Dreamweaver? – Ƭᴇcʜιᴇ007 Mar 16 '11 at 13:45
I can't keep up with the number of SE sites anymore. Feel free to move it to whichever site warrants it. As for version, it's CS5 – DA. Mar 16 '11 at 13:52
up vote 1 down vote accepted

You could try doing a search and replace for all 'onClick' to 'onclick' in dreamweavers configuration folder. Here's a person who did it and had some luck.

An aside I would recommend taking the time to learn Vim. Your output might be lacking slightly for a month but if you use it consistently you will overcome it in no time! (speaking from experience)

share|improve this answer
This looks like the solution. Brute force FTW! – DA. Mar 16 '11 at 13:55

Perhaps check out the DW code rewriting preferences:

  • Fix Invalidly Nested and Unclosed TagsRewrites overlapping tags. For example, text is rewritten as text. This option also inserts closing quotation marks and closing brackets if they are missing.

  • Rename Form Items When PastingEnsures you don’t have duplicate names for form objects. This option is enabled by default. Note: Unlike the other options in this preferences dialog box, this option does not apply when you open a document, only when you copy and paste a form element.

  • Remove Extra Closing TagsDeletes closing tags that have no corresponding opening tag.

  • Warn When Fixing Or Removing TagsDisplays a summary of technically invalid HTML that Dreamweaver attempted to correct. The summary notes the location of the problem (using line and column numbers) so that you can find the correction and ensure that it’s rendering as intended.

  • Never Rewrite Code: In Files With ExtensionsAllows you to prevent Dreamweaver from rewriting code in files with the specified filename extensions. This option is particularly useful for files that contain third-party tags.

  • Encode <, >, &, And " In Attribute Values Using &Ensures that attribute values that you enter or edit using Dreamweaver tools such as the Property inspector contain only legal characters. This option is enabled by default. Note: This option and the following options do not apply to URLs that you type in Code view. Also, they do not cause existing code already in a file to change.

  • Do Not Encode Special CharactersPrevents Dreamweaver from changing URLs to use only legal characters. This option is enabled by default.

  • Encode Special Characters In URL Using &#Ensures that when you enter or edit URLs using Dreamweaver tools such as the Property inspector, those URLs contain only legal characters.

  • Encode Special Characters In URL Using %Operates the same way as the preceding option, but uses a different method of encoding special characters. This encoding method (using the percent sign) may be more compatible with older browsers, but doesn’t work as well with characters from some languages.

share|improve this answer
This is a bug outside of the code rewriting preferences. Which is why it's so infuriating. ;) – DA. Mar 16 '11 at 13:54

So write a script that does the conversion. A simple sed script should work:

sed s/onClick/onclick/g

share|improve this answer
-1 DA01 asks if there is a way to stop DreamWeaver from behaving as it is, not how to change them all. – Jonathan Khoo Mar 16 '11 at 4:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .