Dreamweaver CS3 - InsertRecord.js Bug
Another day, another random mind-boggling Dreamweaver crash.
A few days ago, I was working on a PHP/MySQL project. The project was simple and the timeline was short so I opted to use Dreamweaver's built-in functions to connect to my database and insert values from my form when a user clicked the submit button. I'd done this before and it's simple enough, but this time when I tried to do it Dreamweaver gave me this lovely error message:
While executing onChange in InsertRecord.htm, the following JavaScript error(s) occurred:
At line 646 of file "C:\Program Files\Adobe\Adobe Dreamweaver CS3\configuration\ServerBehaviors\PHP_MySQL\InsertRecord.js": TypeError: name has no properties
An hour of searching Google didn't help me find a solution so I finally opened this JavaScript file and decided to figure it out myself.
The answer is surprisingly simple. It turns out that the problem was due to my form elements not having a name attribute. I typically write all my XHTML from scratch and generally just give all my form elements an ID attribute. The JavaScript that Dreamweaver uses to identify the form elements (and match them with their database fields) relies solely on the name attribute. Without it, Dreamweaver throws this not so graceful error message.
So there you have it. If you get this error message, double check that all of your form fields have proper names.
Leave a comment