DW error message

bunglebrown

New Member
Messages
157
Reaction score
0
Points
0
I don't know if anyone knows what is going on with my database but when I try to insert a record in dreamweaver so that user entries will be entered into my database I get the following error message:

While executing onChange in InsertRecord.htm, the following JavaScript error(s) occurred:

At line 646 of file "C:\Program Files\Adobe Dreamweaver CS3\Configuration\ServerBehaviors\PHP_MySQL\InsertRecord.js":

TypeError: name has no properties

I can't say I understand why or what I should do as my database is connected to mySQL perfectly - anyone know?
 

Nathan H

New Member
Messages
562
Reaction score
0
Points
0
The problem looks like it is with your installation of dreamweaver, i highly recommend that you reinstall the program from the disk again
 

bunglebrown

New Member
Messages
157
Reaction score
0
Points
0
I've done that and the same error message appears - this is ruining me . . anyone??? I desperately need to insert user data into my database and there seems no other way of doing it unless someone has the code for doing it and maybe just maybe that could work.

This is the file in question though (it's fairly big), if anyone can spot anything out of the ordinary please o please let me know.

Code:
// Copyright 2002-2006 Adobe Macromedia Software LLC and its licensors. All rights reserved.

// *************** GLOBALS VARS *****************

var HELP_DOC = MM.HELP_sbPHPInsertRecord;

var SB_NAME = dwscripts.getSBFileName();

var _FormName = new TagMenu(SB_NAME, "form__tag", "form"); 
var _ConnectionName = new ConnectionMenu("Recordset.htm", "ConnectionName");
var _TableName = new ConnectionTableMenu(SB_NAME, "TableName");

var _ColumnList = null;
var _SubmittedValueList = new FormFieldsMenu(SB_NAME, "SubmittedValueList", true,
                                             FormFieldsMenu.LABELS_MASK_FORMREF,
                                             [{prop: "type", value: "submit"}, 
                                              {prop: "type", value: "reset"},
                                              {prop: "name", value: "MM_insert"},
                                              {prop: "name", value: "MM_delete"},
                                              {prop: "name", value: "MM_update"}]);
var _FieldColFormat = null;

var _Redirect_url = new TextField(SB_NAME, "Redirect_url");

// Array constants to hold field format values and labels from the _FieldColFormat 
//   control.
var FieldColFormatValues = null;
var FieldColFormatLabels = null;

// Constants used to index into the above arrays.
INDEX_FORMAT_TEXT              = 0;
INDEX_FORMAT_INTEGER           = 1;
INDEX_FORMAT_NUMERIC           = 1;
INDEX_FORMAT_DOUBLE            = 2;
INDEX_FORMAT_DATE              = 3;
INDEX_FORMAT_CHECKBOX_YN       = 4;
INDEX_FORMAT_CHECKBOX_POS      = 5;
INDEX_FORMAT_CHECKBOX_NEG      = 6;



// ***************** LOCAL FUNCTIONS  ******************

//--------------------------------------------------------------------
// FUNCTION:
//   initializeUI
//
// DESCRIPTION:
//   This function is called in the onLoad event.  It is responsible
//   for initializing the UI.
//
// ARGUMENTS:
//   none
//
// RETURNS:
//   nothing
//--------------------------------------------------------------------

function initializeUI()
{
  // Get the UI elements
  setConnectionSuccess = _ConnectionName.initializeUI();

  if (!setConnectionSuccess)
  {
    clickedCancel(); 
  }

  _FormName.initializeUI();
  _ConnectionName.initializeUI();
  _TableName.initializeUI();
  _ColumnList = new ListControl("ColumnList");
  _SubmittedValueList.initializeUI(_FormName);  
  _Redirect_url.initializeUI();
  
  // Load the labels and values from the html for _FieldColFormat. The store the
  //   loaded labels and values for later use.
  _FieldColFormat = new ListControl("FieldColFormat", null, true);
  FieldColFormatValues = _FieldColFormat.getValue('all');
  FieldColFormatLabels = _FieldColFormat.get('all');
  
  updateUI('ConnectionName');
  updateUI('FormName'); 
  
  setSubmitAsDisabledState();
}

//--------------------------------------------------------------------
// FUNCTION:
//   updateUI
//
// DESCRIPTION:
//   This function is called by the UI controls to handle UI updates
//
// ARGUMENTS:
//   control - string - the name of the control sending the event
//   event - string - the event which is being sent
//
// RETURNS:
//   nothing
//--------------------------------------------------------------------

function updateUI(control, event)
{
  if (control == "FormName")
  {
    _SubmittedValueList.updateUI(_FormName, event); 
  }

  else if (control == "ConnectionName")
  {
    // update the table
    _TableName.updateUI(_ConnectionName, event);
  }
  
  else if (control == "TableName")
  {
    // Update the ColumnList
    var columnInfo = dwscripts.getColumnValueList
      (_ConnectionName.getValue(), _TableName.getValue());

    var names = new Array();
    for (var i=0; i < columnInfo.length; i++)
    {
      // map the columns to matching form items
      setDefaultMapping(columnInfo[i], _SubmittedValueList.get('all'), 
                        _SubmittedValueList.getValue('all'));
      
      names.push(getDisplayString(columnInfo[i]));
    }

    _ColumnList.setAll(names, columnInfo);

    updateUI("ColumnList");
  }

  else if (control=="ColumnList")
  {
    var columnInfo = _ColumnList.getValue();

    if (columnInfo)
    {
      var value = getSubmitAsValueFromVarName(columnInfo.getVariableName());
      _SubmittedValueList.pick(value);
      _FieldColFormat.pickValue(columnInfo.getSubmitAs());
    }
          
    setSubmitAsDisabledState(); 
  }
  
  else if (control=="FieldColFormat")
  {
    var columnInfo = _ColumnList.getValue();
    
    columnInfo.setSubmitAs(_FieldColFormat.getValue());
    _ColumnList.set(getDisplayString(columnInfo));
    
    setSubmitAsDisabledState();
  }
  
  else if (control == "SubmittedValueList")
  {
    if (event == "onChange")
    {
      var columnInfo = _ColumnList.getValue();
      
      if (columnInfo)
      {      
        columnInfo.setVariableName(getVarNameFromSubmitAsValue(_SubmittedValueList.get()));

        // Set the default SubmitAs value based on the new submitted value type.
        setDefaultSubmitAs(columnInfo, _SubmittedValueList.get('all'), 
                           _SubmittedValueList.getValue('all'));
        _FieldColFormat.pickValue(columnInfo.getSubmitAs());

        _ColumnList.set(getDisplayString(columnInfo));

        setSubmitAsDisabledState();
      }
    }
  }
  
  else if (control == "Redirect_url")
  {
    var theRedirect_url = dw.browseForFileURL("select", MM.LABEL_FileRedirect,0,0); 
    
    if (theRedirect_url.length > 0)
    {
      // convert any script blocks to concat values
      theRedirect_url = theRedirect_url.replace(/<\?php\s+(?:echo\s+)?/gi, "\" . ");
      theRedirect_url = theRedirect_url.replace(/;?\s*\?>/gi, " . \"");
      
      _Redirect_url.setValue(theRedirect_url); 
    }    
  }

  // default case - throw error message 
  else 
  {
    alert("The following control does not exist: " + control); 
  }
}
  
//--------------------------------------------------------------------
// FUNCTION:
//   findServerBehaviors
//
// DESCRIPTION:
//   Returns an array of ServerBehavior objects, each one representing
//   an instance of this Server Behavior on the page
//
// ARGUMENTS:
//   none
//
// RETURNS:
//   JavaScript Array of ServerBehavior objects
//--------------------------------------------------------------------
function findServerBehaviors()
{
  var sbArray = new Array(); 

  sbArray = dwscripts.findSBs(MM.LABEL_TitleInsertRecord, SBInsertRecord);

  for (var i=0; i < sbArray.length; i++)
  {
    sbArray[i].postProcessFind();
  }

  return sbArray;
}


//--------------------------------------------------------------------
// FUNCTION:
//   canApplyServerBehavior
//
// DESCRIPTION:
//   Returns true if a Server Behavior can be applied to the current
//   document
//
// ARGUMENTS:
//   sbObj - ServerBehavior object - one of the objects returned
//           from findServerBehaviors
//
// RETURNS:
//   boolean - true if the behavior can be applied, false otherwise
//--------------------------------------------------------------------
function canApplyServerBehavior(sbObj)
{
  var success = true;
  var errMsgStr = ""; 
  
  if (findAllForms().length == 0) {  //if there are no forms
    errMsgStr += MM.MSG_NoForms;
    success = false; 
  }  

  if (errMsgStr) alert(errMsgStr); //popup error message
  
  return success;
}


//--------------------------------------------------------------------
// FUNCTION:
//   applyServerBehavior
//
// DESCRIPTION:
//   Collects values from the form elements in the dialog box and
//   adds the Server Behavior to the user's document
//
// ARGUMENTS:
//   sbObj - ServerBehavior object - one of the objects returned
//           from findServerBehaviors
//
// RETURNS:
 
Last edited:

freecrm

New Member
Messages
629
Reaction score
0
Points
0
I use DW CS3 but due to copyright, I can't post a working file; however, I will try to compare the two files and see what I get if there are any differences.

If this doesn't work, I'll try to help with the insert code.
Edit:
Stupidly, I have now compared the two files side by side and they are identical to the character!

So no problems with the file.

This type of error is almost always associated with 3rd party extenstions which screw up the DW configurations files references.

Look for the configuration file and rename it to something else.

Restart your pc and startup DW again. There are two things that could happen.

1) DW automatically generates another clean configuration folder and all should work fine.

2) DW can't find the configuration folder - back to the drawing board!!!

If Option 1 works, keep the new folder and delete the old one that you renamed - Be aware though that this deletes all extensions.

Hope this helps
 
Last edited:
Top